✨ feat(oauth): Implement OAuth token retrieval and refactor login callback handling
This commit is contained in:
@@ -79,3 +79,18 @@ export async function oAuthLogin(body: API.OAthLoginRequest, options?: { [key: s
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** OAuth login get token POST /v1/auth/oauth/login/token */
|
||||
export async function oAuthLoginGetToken(
|
||||
body: API.OAuthLoginGetTokenRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/oauth/login/token', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
+6
@@ -231,6 +231,12 @@ declare namespace API {
|
||||
redirect: string;
|
||||
};
|
||||
|
||||
type OAuthLoginGetTokenRequest = {
|
||||
/** google, facebook, apple, telegram, github etc. */
|
||||
method: string;
|
||||
code: string;
|
||||
};
|
||||
|
||||
type OAuthLoginResponse = {
|
||||
redirect: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user