feat(auth, medusa): Initial auth module middleware (#6271)
note: This is an initial implementation Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
This commit is contained in:
co-authored by
Sebastian Rindom
parent
374b9b1fee
commit
7d5a6f8b00
@@ -15,6 +15,10 @@ import { Context } from "../shared-context"
|
||||
import { FindConfig } from "../common"
|
||||
import { IModuleService } from "../modules-sdk"
|
||||
|
||||
export type JWTGenerationOptions = {
|
||||
expiresIn?: string | number
|
||||
}
|
||||
|
||||
export interface IAuthModuleService extends IModuleService {
|
||||
authenticate(
|
||||
provider: string,
|
||||
@@ -72,6 +76,16 @@ export interface IAuthModuleService extends IModuleService {
|
||||
sharedContext?: Context
|
||||
): Promise<AuthUserDTO>
|
||||
|
||||
generateJwtToken(
|
||||
authUserId: string,
|
||||
scope: string,
|
||||
options?: JWTGenerationOptions
|
||||
): Promise<string>
|
||||
retrieveAuthUserFromJwtToken(
|
||||
token: string,
|
||||
scope: string
|
||||
): Promise<AuthUserDTO>
|
||||
|
||||
listAuthUsers(
|
||||
filters?: FilterableAuthProviderProps,
|
||||
config?: FindConfig<AuthUserDTO>,
|
||||
|
||||
Reference in New Issue
Block a user