Add anonymous sign-in provider support to user service and types.
- `Provider` 타입에 `anonymous`를 추가하여 비회원 인증 상태를 명시적으로 처리합니다. - `userService`의 인증 제공자 식별 로직에 `anonymous` 타입을 포함하여 예외 발생을 방지하고 유연한 사용자 관리를 지원합니다.
This commit is contained in:
parent
0f8443bc40
commit
e466676210
@ -79,6 +79,7 @@ function providerFromToken(token: DecodedIdToken): Provider {
|
|||||||
const raw = token.firebase?.sign_in_provider;
|
const raw = token.firebase?.sign_in_provider;
|
||||||
if (raw === "google.com") return "google";
|
if (raw === "google.com") return "google";
|
||||||
if (raw === "apple.com") return "apple";
|
if (raw === "apple.com") return "apple";
|
||||||
|
if (raw === "anonymous") return "anonymous";
|
||||||
throw new HttpError(
|
throw new HttpError(
|
||||||
400,
|
400,
|
||||||
`unsupported sign-in provider: ${raw}`,
|
`unsupported sign-in provider: ${raw}`,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import type { Timestamp } from "firebase-admin/firestore";
|
import type { Timestamp } from "firebase-admin/firestore";
|
||||||
import type { DateString } from "./dateString";
|
import type { DateString } from "./dateString";
|
||||||
|
|
||||||
export type Provider = "google" | "apple";
|
export type Provider = "google" | "apple" | "anonymous";
|
||||||
|
|
||||||
export type DailyJudgment = "perfect" | "success" | "fail" | "skip";
|
export type DailyJudgment = "perfect" | "success" | "fail" | "skip";
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user