feat(auth): add Messenger topup handoff entry
Docker Image / Build and Push Docker Image (push) Successful in 2m9s
Docker Image / Build and Push Docker Image (push) Successful in 2m9s
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"googleLogin": { "method": "post", "path": "/api/auth/login/google" },
|
||||
"facebookLogin": { "method": "post", "path": "/api/auth/login/facebook" },
|
||||
"facebookIdLogin": { "method": "post", "path": "/api/auth/login/facebook/by-id" },
|
||||
"facebookPsidLogin": { "method": "post", "path": "/api/auth/login/facebook/psid" },
|
||||
"topUpHandoffConsume": { "method": "post", "path": "/api/auth/handoff/topup/consume" },
|
||||
"refresh": { "method": "post", "path": "/api/auth/refresh" },
|
||||
"logout": { "method": "post", "path": "/api/auth/logout" },
|
||||
"getCurrentUser": { "method": "get", "path": "/api/auth/me" },
|
||||
|
||||
@@ -27,8 +27,8 @@ export class ApiPath {
|
||||
/** Facebook ID 登录(v7.0 新增) */
|
||||
static readonly facebookIdLogin = apiContract.facebookIdLogin.path;
|
||||
|
||||
/** Facebook PSID 登录 */
|
||||
static readonly facebookPsidLogin = apiContract.facebookPsidLogin.path;
|
||||
/** 消费一次性充值登录凭证 */
|
||||
static readonly topUpHandoffConsume = apiContract.topUpHandoffConsume.path;
|
||||
|
||||
/** 刷新 Token */
|
||||
static readonly refresh = apiContract.refresh.path;
|
||||
|
||||
@@ -11,9 +11,6 @@ import {
|
||||
FacebookIdentityResponse,
|
||||
FacebookIdentityResponseSchema,
|
||||
FacebookLoginRequest,
|
||||
FacebookPsidLoginRequest,
|
||||
FacebookPsidLoginResponse,
|
||||
FacebookPsidLoginResponseSchema,
|
||||
FbIdLoginRequest,
|
||||
GoogleLoginRequest,
|
||||
GuestLoginRequest,
|
||||
@@ -26,6 +23,9 @@ import {
|
||||
RefreshTokenResponse,
|
||||
RefreshTokenResponseSchema,
|
||||
RegisterRequest,
|
||||
TopUpHandoffRequest,
|
||||
TopUpHandoffResponse,
|
||||
TopUpHandoffResponseSchema,
|
||||
} from "@/data/schemas/auth";
|
||||
import { User, UserSchema } from "@/data/schemas/user";
|
||||
import type { UserData } from "@/data/schemas/user/user";
|
||||
@@ -91,17 +91,15 @@ export class AuthApi {
|
||||
return LoginResponseSchema.parse(unwrap(env) as Record<string, unknown>);
|
||||
}
|
||||
|
||||
/**
|
||||
* Facebook PSID 登录
|
||||
*/
|
||||
async facebookPsidLogin(
|
||||
body: FacebookPsidLoginRequest,
|
||||
): Promise<FacebookPsidLoginResponse> {
|
||||
/** 消费一次性充值登录凭证。当前正式登录 token 会由拦截器自动携带。 */
|
||||
async consumeTopUpHandoff(
|
||||
body: TopUpHandoffRequest,
|
||||
): Promise<TopUpHandoffResponse> {
|
||||
const env = await httpClient<ApiEnvelope<unknown>>(
|
||||
ApiPath.facebookPsidLogin,
|
||||
ApiPath.topUpHandoffConsume,
|
||||
{ method: "POST", body },
|
||||
);
|
||||
return FacebookPsidLoginResponseSchema.parse(
|
||||
return TopUpHandoffResponseSchema.parse(
|
||||
unwrap(env) as Record<string, unknown>,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user