Code Monkey home page Code Monkey logo

auth-template's Issues

Vapor 4

Hi
This template is not updated to work in Vapor 4

thank you

Installation failed

Hello,

I just tried to start a new project with the auth api template. When i want to start, building Docker image or create a Xcode project file, i have this error :

Fetching https://github.com/vapor/vapor.git
Fetching https://github.com/vapor/fluent-sqlite.git
Fetching https://github.com/vapor/console.git
Fetching https://github.com/vapor/core.git
Fetching https://github.com/vapor/crypto.git
Fetching https://github.com/vapor/database-kit.git
Fetching https://github.com/vapor/http.git
Fetching https://github.com/vapor/multipart.git
Fetching https://github.com/vapor/routing.git
Fetching https://github.com/vapor/service.git
Fetching https://github.com/vapor/template-kit.git
Fetching https://github.com/vapor/url-encoded-form.git
Fetching https://github.com/vapor/validation.git
Fetching https://github.com/vapor/websocket.git
error: failed to clone; Clonage dans le dépôt nu '/Users/xxx/Documents/auth/.build/repositories/database-kit.git-1600799374221354102'
/Users/xxx/Documents/auth/.build/repositories/database-kit.git-1600799374221354102: Permission denied
error: cyclic dependency declaration found: auth -> auth
'auth' /Users/xxx/Documents/auth: error: product dependency 'Authentication' not found
'auth' /Users/xxx/Documents/auth: error: product dependency 'FluentSQLite' not found
'auth' /Users/xxx/Documents/auth: error: product dependency 'Vapor' not found
Segmentation fault: 11

I guess a dependancy is corrumped and can break the installation. or something else ?

Regards,

Tchoupinax. :)

Postman returns invalidCredentials when posting to Login method

When using Postman to test this REST API, I keep getting 'invalidCredentials' error when calling the 'Login' method (with Basic Auth header key). For some reason the verify() in Hash extension of BCrypt 1.1.0 dependency fails but I don't know why (I use PostgreSQL to save the User & Token data).

Anyone any idea how to fix this ?

thanks in advance
Frank

Request to add client tests on routes

Please add tests in auth-template/Tests/AppTests/AppTests.swift.

I'm having difficulty sending simple HTTP POST and GET requests as a Vapor client from within AppTests.swift and would really benefit from seeing it exemplified here. For instance, I cannot call Droplet() even after I import Vapor.

So far, I'm trying to do some basic BDD (Node.js + Express with mocha/chai/jasmine inspired-style):

import Quick
import Nimble
import Vapor

@testable import App

class RoutesSpec: QuickSpec {
    
    let testUrl = "http://localhost:8080"
    
    override func spec() {
        describe("User can create account") {
            it("should respond with error JSON when an incorrect body is sent") {
                
                // @todo use Vapor to make simple HTTP POST here
                
                do {
                    // @todo .....
                    // (I've tried looking in the Vapor documentation... 
                    // I'm still unsure how to make simple HTTP requests...
                    // Request for example here...) ??
                } catch {
                    print("Error")
                }
                
                expect(false).toEventually(beTrue())
            }
            
            it("should respond respond with a user JSON when a correct body is sent") {
                // (@todo ....)                
                expect(false).toEventually(beTrue())
            }
            
        }
        
        
    }
}

Bad Practice for hashing passwords

In the Auth Template example it uses the drop.hash to create a hashed password, which is configured to use a SHA256 hasher. This is not secure! To make it explicit, the passwordVerifier on the User should use a BCryptHasher to show best practises.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.