MAPG-69 merge SignupController to LoginController and introduce Google login/sign up

This commit is contained in:
bence committed 2020-06-21 15:12:45 +02:00
1 parent d1c9e221f7
commit 9697163457
12 files changed
+345 -178

No files matched your search

File renamed without changes.
File renamed without changes.
+9
View File
@@ -0,0 +1,9 @@
<?php require ROOT . '/views/templates/main_header.php'; ?>
<?php require ROOT . '/views/templates/header.php'; ?>
<div class="main">
<h2>Login up with Google</h2>
<div class="box">
<p class="error justify">Authenticating with Google failed. Please <a href="/login/google" title="Login with Google">retry</a>!</p>
</div>
</div>
<?php require ROOT . '/views/templates/main_footer.php'; ?>
+40
View File
@@ -0,0 +1,40 @@
<?php require ROOT . '/views/templates/main_header.php'; ?>
<?php require ROOT . '/views/templates/header.php'; ?>
<div class="main">
<h2>Sign up</h2>
<div class="box">
<form id="googleSignupForm" action="/signup/google" method="post">
<?php if ($found): ?>
<p class="justify">Please confirm that you link your account to your Google account.</p>
<?php else: ?>
<p class="justify">Please confirm your sign up request. Your account will be linked to your Google account.</p>
<?php endif; ?>
<input class="big fullWidth marginTop" type="email" name="email" placeholder="Email address" value="<?= $email ?>" disabled>
<div class="right marginTop">
<button type="submit">
<?php if ($found): ?>
Link
<?php else: ?>
Sign up
<?php endif; ?>
</button>
</div>
</form>
</div>
</div>
<script>
(function () {
var form = document.getElementById('googleSignupForm');
form.onsubmit = function (e) {
document.getElementById('loading').style.visibility = 'visible';
e.preventDefault();
MapGuesser.httpRequest('POST', form.action, function () {
window.location.replace('/');
});
};
})();
</script>
<?php require ROOT . '/views/templates/main_footer.php'; ?>
@@ -15,6 +15,10 @@ $jsFiles = [
<div class="right marginTop">
<button type="submit">Login</button>
</div>
<hr>
<div class="center">
<a class="button yellow" href="/login/google" title="Login with Google">Login with Google</a>
</div>
</form>
</div>
</div>
@@ -16,6 +16,10 @@ $jsFiles = [
<div class="right marginTop">
<button type="submit">Sign up</button>
</div>
<hr>
<div class="center">
<a class="button yellow" href="/login/google" title="Signup with Google">Signup with Google</a>
</div>
</form>
</div>
</div>