ShiftWise API Docs
    Preparing search index...

    Function verifyRefreshToken

    • Verifies a refresh token and returns its decoded payload.

      Called in the /api/auth/refresh route after checking the token exists in the database and has not expired.

      Parameters

      • token: string

        The raw JWT string from the refreshToken cookie

      Returns AccessTokenPayload

      Decoded AccessTokenPayload

      JsonWebTokenError if the token is malformed or has an invalid signature

      TokenExpiredError if the token has expired

      const payload = verifyRefreshToken(cookieToken)