1
0
Fork 0
mirror of synced 2024-05-20 04:32:37 +12:00

New fallback OAuth template

This commit is contained in:
Eldad Fux 2020-04-08 16:14:52 +03:00
parent 8af011f638
commit 3dcba7cc3f
4 changed files with 17 additions and 6 deletions

View file

@ -109,12 +109,12 @@ $utopia->get('/auth/recovery/reset')
});
$utopia->get('/auth/success')
$utopia->get('/auth/oauth2/success')
->desc('Registration page')
->label('permission', 'public')
->label('scope', 'home')
->action(function () use ($layout) {
$page = new View(__DIR__.'/../../views/home/auth/success.phtml');
$page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml');
$layout
->setParam('title', APP_NAME)
@ -124,12 +124,12 @@ $utopia->get('/auth/success')
;
});
$utopia->get('/auth/failure')
$utopia->get('/auth/oauth2/failure')
->desc('Registration page')
->label('permission', 'public')
->label('scope', 'home')
->action(function () use ($layout) {
$page = new View(__DIR__.'/../../views/home/auth/failure.phtml');
$page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml');
$layout
->setParam('title', APP_NAME)

View file

@ -1 +0,0 @@
<script>window.location = 'appwrite-callback://'+window.document.cookie;</script>

View file

@ -0,0 +1,13 @@
<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 <a href="https://<?php echo APP_DOMAIN; ?>/docs/account?platform=web&language=javascript#createOAuth2Session">OAuth docs</a> and send request for new session with a valid callback URL.</p>
</div>
<script>
setTimeout(function () {
document.getElementById('message').style.display = 'block';
}, 25);
window.location = 'appwrite-callback://'+window.location.search;
</script>
<hr />

View file

@ -1 +0,0 @@
<script>window.location = 'appwrite-callback://'+window.document.cookie;</script>