API Reference
Rockets Core API
nestjs-jwt
classes
JwtStrategy

Class: JwtStrategy

Extends

  • Strategy

Extended by

Constructors

new JwtStrategy()

new JwtStrategy(options, verify): JwtStrategy

Parameters

ParameterType
optionsJwtStrategyOptionsInterface
verifyVerifyCallback

Returns

JwtStrategy

Overrides

PassportStrategy.constructor

Defined in

packages/nestjs-jwt/src/jwt.strategy.ts:7 (opens in a new tab)

Methods

authenticate()

authenticate(...args): void

Performs authentication for the request. Note: Virtual function - re-implement in the strategy.

Parameters

ParameterType
...args[Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, any]

Returns

void

Overrides

PassportStrategy.authenticate

Defined in

packages/nestjs-jwt/src/jwt.strategy.ts:17 (opens in a new tab)


error()

error(err): void

Internal error while performing authentication.

Strategies should call this function when an internal error occurs during the process of performing authentication; for example, if the user directory is not available.

Parameters

ParameterType
errError

Returns

void

Api

public

Inherited from

PassportStrategy.error

Defined in

node_modules/@types/passport-strategy/index.d.ts:90


fail()

fail(challenge, status)

fail(challenge, status): void

Fail authentication, with optional challenge and status, defaulting to 401.

Strategies should call this function to fail an authentication attempt.

Parameters
ParameterTypeDescription
challengeany(Can also be an object with 'message' and 'type' fields).
statusnumber-
Returns

void

Api

public

Inherited from

PassportStrategy.fail

Defined in

node_modules/@types/passport-strategy/index.d.ts:54

fail(status)

fail(status): void

Parameters
ParameterType
statusnumber
Returns

void

Inherited from

PassportStrategy.fail

Defined in

node_modules/@types/passport-strategy/index.d.ts:55


pass()

pass(): void

Pass without making a success or fail decision.

Under most circumstances, Strategies should not need to call this function. It exists primarily to allow previous authentication state to be restored, for example from an HTTP session.

Returns

void

Api

public

Inherited from

PassportStrategy.pass

Defined in

node_modules/@types/passport-strategy/index.d.ts:78


redirect()

redirect(url, status?): void

Redirect to url with optional status, defaulting to 302.

Strategies should call this function to redirect the user (via their user agent) to a third-party website for authentication.

Parameters

ParameterType
urlstring
status?number

Returns

void

Api

public

Inherited from

PassportStrategy.redirect

Defined in

node_modules/@types/passport-strategy/index.d.ts:67


success()

success(user, info?): void

Authenticate user, with optional info.

Strategies should call this function to successfully authenticate a user. user should be an object supplied by the application after it has been given an opportunity to verify credentials. info is an optional argument containing additional user information. This is useful for third-party authentication strategies to pass profile details.

Parameters

ParameterType
userany
info?any

Returns

void

Api

public

Inherited from

PassportStrategy.success

Defined in

node_modules/@types/passport-strategy/index.d.ts:42