feat: Separate registration from authentication in auth domain (#8683)

* wip

* feat: Introduce register

* fix: user command

* fix: Invite HTTP tests

* fix: Auth tests

* fix: Invite modules tests
This commit is contained in:
Oli Juhl
2024-08-27 13:44:52 +02:00
committed by GitHub
parent c6eba80af6
commit c11ef01c15
21 changed files with 459 additions and 152 deletions
+18
View File
@@ -10,6 +10,24 @@ export class Auth {
this.config = config
}
register = async (
actor: "customer" | "user",
method: "emailpass",
payload: { email: string; password: string }
) => {
const { token } = await this.client.fetch<{ token: string }>(
`/auth/${actor}/${method}/register`,
{
method: "POST",
body: payload,
}
)
this.client.setToken(token)
return token
}
login = async (
actor: "customer" | "user",
method: "emailpass",