Domain Documentation

Structure Authenticate​Middleware​Use​Case

public struct AuthenticateMiddlewareUseCase: UseCase  

Use cases for authentication middlewares.

Initializers

init()

public init()  

Default Initializer.

Methods

payload(by:​)

public func payload(by token: String ) throws -> SessionPayload  

This use case has work of expand payload from JWT.

Parameters

token String

Please pass in the JWT that expand payload.

Throws

See JWTRepository.verifyJWT.

Returns

See SessionPayload.

user(by:​)

public func user(by token: String ) throws -> Future<(Int, User)>  

This use case has work of receiving the JWT and get User's infomation.

Parameters

token String

Please pass in the JWT that expand payload.

Throws

See JWTRepository.verifyJWT.

Returns

The Future that returns (Int, User). Int is User's Id.