Move sessions to db table instead of JWTs
This commit is contained in:
@@ -2,7 +2,6 @@ import NIOSSL
|
||||
import Fluent
|
||||
import FluentSQLiteDriver
|
||||
import Vapor
|
||||
import JWT
|
||||
|
||||
// configures your application
|
||||
public func configure(_ app: Application) async throws {
|
||||
@@ -12,12 +11,11 @@ public func configure(_ app: Application) async throws {
|
||||
app.databases.use(DatabaseConfigurationFactory.sqlite(.file("db.sqlite")), as: .sqlite)
|
||||
|
||||
app.migrations.add(CreateAccount())
|
||||
app.migrations.add(CreatePlayers())
|
||||
app.migrations.add(CreateSessions())
|
||||
app.http.server.configuration.hostname = "0.0.0.0"
|
||||
app.http.server.configuration.port = 8000
|
||||
|
||||
// JWT
|
||||
await app.jwt.keys.add(hmac: "secret", digestAlgorithm: .sha256)
|
||||
|
||||
// register routes
|
||||
try routes(app)
|
||||
}
|
||||
|
Reference in New Issue
Block a user