Class: OAuthTokenAuthorizationCodeMiddleware
api-oauth/oauth-token-authorization-code.middleware.OAuthTokenAuthorizationCodeMiddleware
Hierarchy
StateMiddleware
<{client
:AuthClient
}>↳
OAuthTokenAuthorizationCodeMiddleware
Constructors
constructor
• new OAuthTokenAuthorizationCodeMiddleware(activeLoginService
, tokenService
, encryptionService
)
Parameters
Name | Type |
---|---|
activeLoginService | ActiveLoginService |
tokenService | TokenService |
encryptionService | EncryptionService |
Overrides
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:16
Properties
activeLoginService
• Private
Readonly
activeLoginService: ActiveLoginService
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:17
encryptionService
• Private
Readonly
encryptionService: EncryptionService
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:19
logger
• Private
Readonly
logger: Logger
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:15
tokenService
• Private
Readonly
tokenService: TokenService
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:18
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
checkLoginDataIsVaild
▸ Private
checkLoginDataIsVaild(loginData?
, activeLogin?
): Promise
<void
>
Parameters
Name | Type |
---|---|
loginData? | UserLoginData |
activeLogin? | ActiveLogin |
Returns
Promise
<void
>
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:28
createAccessToken
▸ Private
createAccessToken(loginData
, activeLogin
, currentClient
, scope
): Promise
<OAuthTokenResponseDto
>
Parameters
Name | Type |
---|---|
loginData | UserLoginData |
activeLogin | ActiveLogin |
currentClient | AuthClient |
scope | TokenScope [] |
Returns
Promise
<OAuthTokenResponseDto
>
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:90
createResponse
▸ Private
createResponse(client
, scope
, activeLogin
): Promise
<OAuthTokenResponseDto
>
Parameters
Name | Type |
---|---|
client | AuthClient |
scope | TokenScope [] |
activeLogin | ActiveLogin |
Returns
Promise
<OAuthTokenResponseDto
>
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:130
throwGenericCodeError
▸ Private
throwGenericCodeError(): void
Returns
void
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:24
updateRefreshTokenIdAndExpirationDate
▸ Private
updateRefreshTokenIdAndExpirationDate(activeLogin
, isRegisterLogin
): Promise
<ActiveLogin
>
Parameters
Name | Type |
---|---|
activeLogin | ActiveLogin |
isRegisterLogin | boolean |
Returns
Promise
<ActiveLogin
>
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:77
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 | { client : AuthClient } & { 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 | { client : AuthClient } & { error? : any } |
next | (error? : any ) => void |
Returns
Promise
<any
>
Overrides
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-authorization-code.middleware.ts:145