feat(authentication): Google authentication provider (#6104)
* init * add entity_id and update provider * initial implementation * update lockfile * fix conflicts * add config variables * update types * refactor google provider * re-order methods * fix pr feedback p. 1 * add initial type and update callback authorization * add google provider to integration test * fix feedback * initial implementation (#6171) * initial implementation * remove oauth lib * move abstract authentication provider * shuffle files around * Update packages/authentication/src/migrations/Migration20240122041959.ts Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> * call verify with token --------- Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { AuthenticationResponse } from "@medusajs/types";
|
||||
|
||||
export abstract class AbstractAuthenticationModuleProvider {
|
||||
public static PROVIDER: string
|
||||
public static DISPLAY_NAME: string
|
||||
|
||||
public get provider() {
|
||||
return (this.constructor as Function & { PROVIDER: string }).PROVIDER
|
||||
}
|
||||
|
||||
public get displayName() {
|
||||
return (this.constructor as Function & { DISPLAY_NAME: string })
|
||||
.DISPLAY_NAME
|
||||
}
|
||||
|
||||
abstract authenticate(
|
||||
data: Record<string, unknown>
|
||||
): Promise<AuthenticationResponse>
|
||||
}
|
||||
1
packages/utils/src/authentication/index.ts
Normal file
1
packages/utils/src/authentication/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./abstract-authentication-provider"
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from "./authentication"
|
||||
export * from "./bundles"
|
||||
export * from "./common"
|
||||
export * from "./dal"
|
||||
|
||||
Reference in New Issue
Block a user