Class: JwtStrategy
Extends
Strategy
Extended by
Constructors
new JwtStrategy()
new JwtStrategy(
options
,verify
):JwtStrategy
Parameters
Parameter | Type |
---|---|
options | JwtStrategyOptionsInterface |
verify | VerifyCallback |
Returns
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
Parameter | Type |
---|---|
...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
Parameter | Type |
---|---|
err | Error |
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
Parameter | Type | Description |
---|---|---|
challenge | any | (Can also be an object with 'message' and 'type' fields). |
status | number | - |
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
Parameter | Type |
---|---|
status | number |
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
Parameter | Type |
---|---|
url | string |
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
Parameter | Type |
---|---|
user | any |
info ? | any |
Returns
void
Api
public
Inherited from
PassportStrategy.success
Defined in
node_modules/@types/passport-strategy/index.d.ts:42