Class: AuthRedirectMiddleware
api-internal/auth-redirect.middleware.AuthRedirectMiddleware
Hierarchy
StateMiddleware
<AuthStateServerData
&OAuthAuthorizeServerState
& {secondToken?
:boolean
;strategy
:Strategy
}>↳
AuthRedirectMiddleware
Constructors
constructor
• new AuthRedirectMiddleware(tokenService
, activeLoginService
, stateJwtService
, userService
)
Parameters
Name | Type |
---|---|
tokenService | TokenService |
activeLoginService | ActiveLoginService |
stateJwtService | JwtService |
userService | LoginUserService |
Overrides
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:48
Properties
activeLoginService
• Private
Readonly
activeLoginService: ActiveLoginService
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:50
logger
• Private
Readonly
logger: Logger
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:47
stateJwtService
• Private
Readonly
stateJwtService: JwtService
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:52
tokenService
• Private
Readonly
tokenService: TokenService
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:49
userService
• Private
Readonly
userService: LoginUserService
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:53
Methods
appendState
▸ Protected
appendState(res
, appendedState
): void
Parameters
Name | Type |
---|---|
res | Response <any , Record <string , any >> |
appendedState | { error? : any } | Partial <{}> & { error? : any } |
Returns
void
Inherited from
Defined in
gropius-login-service/backend/src/api-oauth/StateMiddleware.ts:42
assignActiveLoginToClient
▸ Private
assignActiveLoginToClient(state
, expiresIn
): Promise
<number
>
Parameters
Name | Type |
---|---|
state | AuthStateServerData & OAuthAuthorizeServerState & { secondToken? : boolean } |
expiresIn | number |
Returns
Promise
<number
>
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:58
generateCode
▸ Private
generateCode(state
, clientId
, scope
, pkce
): Promise
<string
>
Parameters
Name | Type |
---|---|
state | AuthStateServerData & OAuthAuthorizeServerState & { secondToken? : boolean } |
clientId | string |
scope | TokenScope [] |
pkce | boolean |
Returns
Promise
<string
>
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:85
getDataSuggestions
▸ getDataSuggestions(loginData
, strategy
): Promise
<UserDataSuggestion
>
Return username, display name and email suggestions for registering a user
Parameters
Name | Type |
---|---|
loginData | UserLoginData |
strategy | Strategy |
Returns
Promise
<UserDataSuggestion
>
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:115
redirectWithCode
▸ Private
redirectWithCode(state
, res
): Promise
<void
>
Parameters
Name | Type |
---|---|
state | AuthStateServerData & OAuthAuthorizeServerState & { strategy : Strategy } & { error? : any } |
res | Response <any , Record <string , any >> |
Returns
Promise
<void
>
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:177
use
▸ use(req
, res
, next
): Promise
<void
>
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
res | Response <any , Record <string , any >> |
next | (error? : any ) => any |
Returns
Promise
<void
>
Inherited from
Defined in
gropius-login-service/backend/src/api-oauth/StateMiddleware.ts:8
useWithError
▸ Protected
useWithError(req
, res
, state
, error
, next
): void
Overwrite this to handle errors
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
res | Response <any , Record <string , any >> |
state | AuthStateServerData & OAuthAuthorizeServerState & { secondToken? : boolean ; strategy : Strategy } & { error? : any } |
error | any |
next | (error? : any ) => void |
Returns
void
Inherited from
Defined in
gropius-login-service/backend/src/api-oauth/StateMiddleware.ts:32
useWithState
▸ Protected
useWithState(req
, res
, state
, next
): Promise
<any
>
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
res | Response <any , Record <string , any >> |
state | AuthStateServerData & OAuthAuthorizeServerState & { strategy : Strategy } & { error? : any } |
next | (error? : any ) => void |
Returns
Promise
<any
>
Overrides
Defined in
gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:136