Vapor jwt signer call to unverified function, gives error no exact match in call to instance method

I have implemented jwt tokens on my site without using sessions. When I take a route that is having my jwtbearerauthenticator it does the authenticatte but I saw that req.auth.require is throwing.
So my thought is that since jwt is sessionless I am supposed to unencrypt the token and then get the user again and do req.auth.login again. Is this correct? This is why I am making the call to unverified. Here's some code.

func me(req: Request) throws -> EventLoopFuture<Me> {
    print("entered me")
    let signer = JWTSigners()
    let token = req.headers["Authorization"]
    let jwtPayload = signer.get(kid: .private)?.unverified(token, as: JWTPayload.Protocol)
    let user = try req.auth.require(User.self)
    let userName = user.userName
    print("entered \(userName)")
    return User.query(on: req.db)
        .filter(\.$userName == userName)
        .unwrap(or: Abort(.notFound))
        .map { usr in
            print("sending me \(usr.userName)")
            return Me(id:, userName: usr.userName)
    throw Abort(.unauthorized)

func boot(routes: RoutesBuilder) throws {
    let users = routes.grouped("users")"register") { usr in register)
    }"login") { usr in
        print("entered login group") login)
        .group("me") { usr in
            usr.get(use: me)

hi @jsoneaday consider posting in which is more focused on vapor

I figured everything out, but it was so complicated I made a video on it. This is an end to end setup with Vapor server and SwiftUI client.

... :roll_eyes:

Terms of Service

Privacy Policy

Cookie Policy