feat(authentication, types): split authenticate method into two (#6184)
* init * fetch providers using updated string * update loaders * add more tests * add authenticationresponse type * update types for authentication method * add entity_id and update provider * update pr with return type * create loaders onApplicationStart * cleanup provider class * run application start hook before each * fix pr feedback * create private onApplicationStart method * assign repository * 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 * 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> * split authentication methods * call verify with token * update integration tests * feedback * rename split methods * fix provider integration test --------- Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { AuthenticationResponse } from "@medusajs/types";
|
||||
import { AuthenticationResponse } from "@medusajs/types"
|
||||
|
||||
export abstract class AbstractAuthenticationModuleProvider {
|
||||
public static PROVIDER: string
|
||||
@@ -16,4 +16,12 @@ export abstract class AbstractAuthenticationModuleProvider {
|
||||
abstract authenticate(
|
||||
data: Record<string, unknown>
|
||||
): Promise<AuthenticationResponse>
|
||||
|
||||
public validateCallback(
|
||||
data: Record<string, unknown>
|
||||
): Promise<AuthenticationResponse> {
|
||||
throw new Error(
|
||||
`Callback authentication not implemented for provider ${this.provider}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user