vapor / auth-template Goto Github PK
View Code? Open in Web Editor NEWA starting point for Vapor applications using the auth provider.
A starting point for Vapor applications using the auth provider.
The read the docs badge on the readme points to: http://127.0.0.1:8000/auth/getting-started/
Hi
This template is not updated to work in Vapor 4
thank you
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. :)
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
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())
}
}
}
}
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.