impl session tokens

This commit is contained in:
Andrew Glaze
2025-05-16 11:56:30 -04:00
parent 0fb66832e1
commit a508348fac
6 changed files with 113 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ import NIOSSL
import Fluent
import FluentSQLiteDriver
import Vapor
import JWT
// configures your application
public func configure(_ app: Application) async throws {
@@ -14,6 +15,9 @@ public func configure(_ app: Application) async throws {
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)
}