1
0
Fork 0
mirror of synced 2024-06-14 00:34:51 +12:00

feat(auth): forward OAuth2 callback params

The only place Apple includes the user's name is in the params so we
need to forward the params to the redirect endpoint so they can be used
when creating the user.
This commit is contained in:
Steven Nguyen 2024-05-08 17:36:46 +00:00 committed by GitHub
parent 239a0b4dde
commit df064adce3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1069,17 +1069,15 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
$domain = $request->getHostname();
$protocol = $request->getProtocol();
$params = $request->getParams();
$params['project'] = $projectId;
unset($params['projectId']);
$response
->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->addHeader('Pragma', 'no-cache')
->redirect($protocol . '://' . $domain . '/v1/account/sessions/oauth2/' . $provider . '/redirect?'
. \http_build_query([
'project' => $projectId,
'code' => $code,
'state' => $state,
'error' => $error,
'error_description' => $error_description
]));
. \http_build_query($params));
});
App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
@ -1102,17 +1100,15 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
$domain = $request->getHostname();
$protocol = $request->getProtocol();
$params = $request->getParams();
$params['project'] = $projectId;
unset($params['projectId']);
$response
->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->addHeader('Pragma', 'no-cache')
->redirect($protocol . '://' . $domain . '/v1/account/sessions/oauth2/' . $provider . '/redirect?'
. \http_build_query([
'project' => $projectId,
'code' => $code,
'state' => $state,
'error' => $error,
'error_description' => $error_description
]));
. \http_build_query($params));
});
App::get('/v1/account/sessions/oauth2/:provider/redirect')