diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 07a1efd9a..ce1986526 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -483,6 +483,7 @@ $utopia->get('/v1/account/sessions/oauth2/:provider/redirect') if($state['success'] === $oauthDefaultSuccess) { // Add keys for non-web platforms $state['success'] = URLParser::parse($state['success']); $query = URLParser::parseQuery($state['success']['query']); + $query['project'] = $project->getId(); $query['domain'] = COOKIE_DOMAIN; $query['key'] = Auth::$cookieName; $query['secret'] = Auth::encodeSession($user->getId(), $secret); diff --git a/app/views/home/auth/oauth2.phtml b/app/views/home/auth/oauth2.phtml index 1ac00e7b5..b2410ce69 100644 --- a/app/views/home/auth/oauth2.phtml +++ b/app/views/home/auth/oauth2.phtml @@ -8,6 +8,9 @@ document.getElementById('message').style.display = 'block'; }, 25); - window.location = 'appwrite-callback://'+window.location.search; + const query = new URLSearchParams(window.location.search); + const project = query.get('project'); + + window.location = 'appwrite-callback-'+project+'://'+window.location.search;
\ No newline at end of file