1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

Fix unwanted auth redirect after failed OAuth2 login

This commit is contained in:
Eldad Fux 2020-08-18 08:26:28 +03:00
parent 5c52320c83
commit 7cd9f975d5
5 changed files with 12 additions and 4 deletions

View file

@ -595,7 +595,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
}
// Add keys for non-web platforms - TODO - add verification phase to aviod session sniffing
if (parse_url($state['success'], PHP_URL_PATH) === $oauthDefaultSuccess) {
if (parse_url($state['success'], PHP_URL_PATH) === parse_url($oauthDefaultSuccess, PHP_URL_PATH)) {
$state['success'] = URLParser::parse($state['success']);
$query = URLParser::parseQuery($state['success']['query']);
$query['project'] = $project->getId();

View file

@ -1,6 +1,6 @@
<div class="zone large padding margin-top" id="message" style="display: none">
<h1 class="margin-bottom">Missing Redirect URL</h1>
<p>Your OAuth login flow is missing a redirect URL. Please check the
<p>Your OAuth login flow is missing a proper redirect URL. Please check the
<a href="https://<?php echo APP_DOMAIN; ?>/docs/client/account?sdk=web#createOAuth2Session">OAuth docs</a>
and send request for new session with a valid callback URL.</p>
</div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -23,6 +23,14 @@ window.ls.router
template: "/auth/join?version=" + APP_ENV.CACHEBUSTER,
scope: "home"
})
.add("/auth/oauth2/success", {
template: "/auth/oauth2/success?version=" + APP_ENV.CACHEBUSTER,
scope: "home"
})
.add("/auth/oauth2/failure", {
template: "/auth/oauth2/failure?version=" + APP_ENV.CACHEBUSTER,
scope: "home"
})
.add("/console", {
template: "/console?version=" + APP_ENV.CACHEBUSTER,
scope: "console"