Feat(authentication): Load auth providers (#6023)

* initial providers loader implementation

* registerAdd providers

* remove comment

* remove comment
This commit is contained in:
Philip Korsholm
2024-01-09 10:02:02 +01:00
committed by GitHub
parent fe81a5e49a
commit f065581736
11 changed files with 148 additions and 15 deletions
@@ -0,0 +1 @@
export { default as UsernamePasswordProvider } from "./username-password"
@@ -0,0 +1,21 @@
import { AuthUserService } from "@services"
import { AbstractAuthenticationModuleProvider } from "@medusajs/types"
class UsernamePasswordProvider extends AbstractAuthenticationModuleProvider {
public static PROVIDER = "usernamePassword"
public static DISPLAY_NAME = "Username/Password Authentication"
protected readonly authUserSerivce_: AuthUserService
constructor({ authUserService: AuthUserService }) {
super()
this.authUserSerivce_ = AuthUserService
}
async authenticate(userData: Record<string, unknown>) {
return {}
}
}
export default UsernamePasswordProvider