fix: signout account when logging through oauth signin via desktop (#4321)

This commit is contained in:
Peng Xiao
2023-09-13 10:10:03 +08:00
committed by GitHub
parent 7d6c150ecd
commit 9ec2b9cf51
4 changed files with 23 additions and 15 deletions

View File

@@ -54,7 +54,7 @@ export const signInCloud: typeof signIn = async (provider, ...rest) => {
`${
runtimeConfig.serverUrlPrefix
}/desktop-signin?provider=google&callback_url=${buildCallbackUrl(
'/open-app/oauth-jwt'
'/open-app/signin-redirect'
)}`,
'_target'
);
@@ -63,7 +63,9 @@ export const signInCloud: typeof signIn = async (provider, ...rest) => {
const [options, ...tail] = rest;
const callbackUrl =
runtimeConfig.serverUrlPrefix +
(provider === 'email' ? '/open-app/oauth-jwt' : location.pathname);
(provider === 'email'
? '/open-app/signin-redirect'
: location.pathname);
return signIn(
provider,
{
@@ -85,8 +87,8 @@ export const signInCloud: typeof signIn = async (provider, ...rest) => {
export const signOutCloud: typeof signOut = async options => {
const traceParams = genTraceParams();
return signOut({
...options,
callbackUrl: '/',
...options,
})
.then(result => {
if (result) {