Feat: support email login (#490)

* may login with email

* update login layout

* update login style
This commit is contained in:
an-lee
2024-04-07 11:38:21 +08:00
committed by GitHub
parent 3d9a1ccba6
commit 52287357d5
4 changed files with 238 additions and 115 deletions

View File

@@ -70,9 +70,10 @@ export class Client {
}
auth(params: {
provider: "mixin" | "github" | "bandu";
provider: "mixin" | "github" | "bandu" | "email";
code: string;
phoneNumber?: string;
email?: string;
}): Promise<UserType> {
return this.api.post("/api/sessions", decamelizeKeys(params));
}
@@ -81,7 +82,7 @@ export class Client {
return this.api.get("/api/me");
}
loginCode(params: { phoneNumber: string }): Promise<void> {
loginCode(params: { phoneNumber?: string; email?: string }): Promise<void> {
return this.api.post("/api/sessions/login_code", decamelizeKeys(params));
}