Ramble-FE / config / oauthConfig.ts
oauthConfig.ts
Raw
import { ClientIdConfig, OAuthConfig, OAuthProvider } from "@/types";
import Constants from 'expo-constants';

export const OAUTH_CONFIGS: Record<OAuthProvider, OAuthConfig> = {
    google: {
        discovery: {
            authorizationEndpoint: "https://accounts.google.com/o/oauth2/v2/auth",
            tokenEndpoint: "https://oauth2.googleapis.com/token",
            revocationEndpoint: "https://oauth2.googleapis.com/revoke",
        },
        scopes: ["openid", "profile", "email"],
    },
    apple: {
        discovery: {
            authorizationEndpoint: "https://appleid.apple.com/auth/authorize",
            tokenEndpoint: "https://appleid.apple.com/auth/token",
            revocationEndpoint: "https://appleid.apple.com/auth/revoke",
        },
        scopes: ["name", "email"],
    },
} as const;

// 클라이언트 ID 환경변수 매핑
export const CLIENT_ID_CONFIGS: Record<OAuthProvider, ClientIdConfig> = {
    google: {
        ios: Constants.expoConfig?.extra?.googleClientIdIos,
        android: Constants.expoConfig?.extra?.googleClientIdAndroid,
        web: Constants.expoConfig?.extra?.googleClientIdWeb,
    },
    apple: {
        ios: Constants.expoConfig?.extra?.appleClientIdIos,
        android: Constants.expoConfig?.extra?.appleClientIdAndroid,
        web: Constants.expoConfig?.extra?.appleClientIdWeb,
    },
} as const;