The SessionAuthenticatable protocol provides a static sessionAuthenticator() function to which a databaseID can be passed as an optional argument:
let protected = app.grouped(
app.session.middleware,
User.sessionAuthenticator(.someDatabase)
)
But this argument is ignored by the DatabaseSessionAuthenticator implementation, which causes an internal server error unless the database in which the User model lives is also the default database.
The
SessionAuthenticatable
protocol provides a staticsessionAuthenticator()
function to which a databaseID can be passed as an optional argument:But this argument is ignored by the
DatabaseSessionAuthenticator
implementation, which causes an internal server error unless the database in which the User model lives is also the default database.