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:
Philip Korsholm
2024-01-24 09:57:58 +08:00
committed by GitHub
parent c37c82c5b5
commit b3d013940f
24 changed files with 402 additions and 87 deletions

View File

@@ -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>
}

View File

@@ -0,0 +1 @@
export * from "./abstract-authentication-provider"

View File

@@ -1,3 +1,4 @@
export * from "./authentication"
export * from "./bundles"
export * from "./common"
export * from "./dal"