Skip to content

auth.Class.LocalAuthService

Sclable CI edited this page Oct 7, 2024 · 7 revisions

@sclable/nestjs-libs / auth / LocalAuthService

Class: LocalAuthService<UserType>

Extends

  • AuthService<UserType>

Type Parameters

UserType extends ApplicationUserContract

Constructors

new LocalAuthService()

new LocalAuthService<UserType>(userService, jwtService): LocalAuthService<UserType>

Parameters

userService: UserServiceContract<UserType>

jwtService: JwtService

Returns

LocalAuthService<UserType>

Overrides

AuthService<UserType>.constructor

Defined in

packages/auth/src/services/local-auth.service.ts:12

Properties

jwtService

protected readonly jwtService: JwtService

Inherited from

AuthService.jwtService

Defined in

packages/auth/src/services/local-auth.service.ts:14

Methods

addToBlacklist()

addToBlacklist(jwtPayload): void

Parameters

jwtPayload: JwtPayload

Returns

void

Inherited from

AuthService.addToBlacklist

Defined in

packages/auth/src/services/auth.service.ts:38


decodeAuthorizationHeaderToken()

decodeAuthorizationHeaderToken(headerToken): JwtPayload

Parameters

headerToken: string

Returns

JwtPayload

Inherited from

AuthService.decodeAuthorizationHeaderToken

Defined in

packages/auth/src/services/auth.service.ts:21


getAccessToken()

getAccessToken(user): Promise<string>

Parameters

user: ApplicationUserContract

Returns

Promise<string>

Defined in

packages/auth/src/services/local-auth.service.ts:23


getApplicationUser()

getApplicationUser(token): Promise<null | UserType>

Parameters

token: JwtPayload

Returns

Promise<null | UserType>

Overrides

AuthService.getApplicationUser

Defined in

packages/auth/src/services/local-auth.service.ts:35


isBlackListed()

isBlackListed(jwtPayload): boolean

Parameters

jwtPayload: JwtPayload

Returns

boolean

Inherited from

AuthService.isBlackListed

Defined in

packages/auth/src/services/auth.service.ts:34


isValid()

isValid(jwtPayload): boolean

Parameters

jwtPayload: JwtPayload

Returns

boolean

Inherited from

AuthService.isValid

Defined in

packages/auth/src/services/auth.service.ts:25


validateUser()

validateUser(username, password): Promise<null | UserType>

Parameters

username: string

password: string

Returns

Promise<null | UserType>

Defined in

packages/auth/src/services/local-auth.service.ts:19


userDataChanged()

protected static userDataChanged(user, token): boolean

Parameters

user: ApplicationUserContract

token: JwtPayload

Returns

boolean

Inherited from

AuthService.userDataChanged

Defined in

packages/auth/src/services/auth.service.ts:12

Clone this wiki locally