Skip to content

sessionAuthenticator ignores databaseID #701

@ehpi

Description

@ehpi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions