1
0
Fork 0
mirror of synced 2024-06-25 17:50:38 +12:00

Added default OAuth handler a unique scheme

This commit is contained in:
Eldad Fux 2020-05-17 14:11:43 +03:00
parent eeb19ff996
commit 11a3d3de58
2 changed files with 5 additions and 1 deletions

View file

@ -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);

View file

@ -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;
</script>
<hr />