Skip to main content

Class: AuthRedirectMiddleware

api-internal/auth-redirect.middleware.AuthRedirectMiddleware

Hierarchy

Constructors

constructor

new AuthRedirectMiddleware(tokenService, activeLoginService, stateJwtService, userService)

Parameters

NameType
tokenServiceTokenService
activeLoginServiceActiveLoginService
stateJwtServiceJwtService
userServiceLoginUserService

Overrides

StateMiddleware.constructor

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

NameType
resResponse<any, Record<string, any>>
appendedState{ error?: any } | Partial<{}> & { error?: any }

Returns

void

Inherited from

StateMiddleware.appendState

Defined in

gropius-login-service/backend/src/api-oauth/StateMiddleware.ts:42


assignActiveLoginToClient

Private assignActiveLoginToClient(state, expiresIn): Promise<number>

Parameters

NameType
stateAuthStateServerData & OAuthAuthorizeServerState & { secondToken?: boolean }
expiresInnumber

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

NameType
stateAuthStateServerData & OAuthAuthorizeServerState & { secondToken?: boolean }
clientIdstring
scopeTokenScope[]
pkceboolean

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

NameType
loginDataUserLoginData
strategyStrategy

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

NameType
stateAuthStateServerData & OAuthAuthorizeServerState & { strategy: Strategy } & { error?: any }
resResponse<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

NameType
reqRequest<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
resResponse<any, Record<string, any>>
next(error?: any) => any

Returns

Promise<void>

Inherited from

StateMiddleware.use

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

NameType
reqRequest<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
resResponse<any, Record<string, any>>
stateAuthStateServerData & OAuthAuthorizeServerState & { secondToken?: boolean ; strategy: Strategy } & { error?: any }
errorany
next(error?: any) => void

Returns

void

Inherited from

StateMiddleware.useWithError

Defined in

gropius-login-service/backend/src/api-oauth/StateMiddleware.ts:32


useWithState

Protected useWithState(req, res, state, next): Promise<any>

Parameters

NameType
reqRequest<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
resResponse<any, Record<string, any>>
stateAuthStateServerData & OAuthAuthorizeServerState & { strategy: Strategy } & { error?: any }
next(error?: any) => void

Returns

Promise<any>

Overrides

StateMiddleware.useWithState

Defined in

gropius-login-service/backend/src/api-internal/auth-redirect.middleware.ts:136