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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user