Skip to content

Commit

Permalink
update third party template
Browse files Browse the repository at this point in the history
  • Loading branch information
danangmassandy committed Jul 27, 2023
1 parent 7cbac9a commit 0534a16
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 10 deletions.
98 changes: 90 additions & 8 deletions django_project/azure_auth/templates/third_party.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,95 @@
<!-- templates/third_party.html -->
{% load static %}
{% load randombg %}
{% randombg as random_bg_image %}
<!DOCTYPE html>
<html>
<html lang="en">
<head>
</head>
<script>
// if (window.opener == null) window.location = "/";
window.opener.postMessage("{{ access_token }}", "{{ requester }}");
<meta charset="UTF-8">
<title>GeoRepo | Sign In</title>
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Rubik:300,300i,500,500i"/>
<link rel="stylesheet" href={% static 'base.css' %}>
<link rel="stylesheet" href={% static 'login.css' %}>
<link rel="stylesheet" href={% static 'navbar.css' %}>
<style>
.login-main .background {
background: url('{% static random_bg_image %}');
background-size: cover;
}

#loading {
display: flex;
flex-direction: row;
align-items: center;
padding-top: 20px;
padding-bottom: 20px;
}

#loading > span {
margin-left: 10px;
}

#loading-spinner {
display: inline-block;
width: 30px;
height: 30px;
border: 3px solid rgba(255,255,255,.3);
border-radius: 50%;
border-top-color: var(--primary-color);
animation: spin 1s ease-in-out infinite;
-webkit-animation: spin 1s ease-in-out infinite;
}

// window.close();
</script>
@keyframes spin {
to { -webkit-transform: rotate(360deg); }
}
@-webkit-keyframes spin {
to { -webkit-transform: rotate(360deg); }
}

</style>
<script src="https://code.jquery.com/jquery-3.7.0.min.js" integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script>
<script>
$(function() {
if (window.opener == null) window.location = "/";
setTimeout(function() {
window.opener.postMessage("{{ access_token }}", "{{ requester }}");
$('#loading').hide();
// show success message
$('#success-message').show();
}, 1500);
});
</script>
</head>
<body>
<div class="login-app">
<div class="login-root">
<div class="login-header">
{% include "navbar.html" %}
</div>
<div class="login-main">
<div class="background">
</div>
<div class="login-container signup-form">
<div class="login-form-header">
GeoRepo Sign In
</div>
<div class="login-form">
<div id="loading">
<div id="loading-spinner"></div>
<span>Logging in to GeoRepo...</span>
</div>
<p id="success-message" style="display: none;">You have successfully logged in. You may close this browser tab.</p>
<p id="error-message" style="display: none;">There is an unexpected error during sign in process. Please try again or contact administrator!</p>
</div>
</div>
</div>

</div>
</div>

</body>
</html>
</html>
3 changes: 1 addition & 2 deletions django_project/azure_auth/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
urlpatterns = [
path("azure-auth/login", azure_auth_login, name="login"),
path("azure-auth/logout", azure_auth_logout, name="logout"),
# path("signin-oidc", azure_auth_callback, name="callback"),
path("auth/redirect", azure_auth_callback, name="callback"),
path("signin-oidc", azure_auth_callback, name="callback"),
path("redirect", azure_auth_redirect, name="redirect"),
path("azure-auth/third-party", azure_auth_third_party, name="third-party"),
]
Expand Down

0 comments on commit 0534a16

Please sign in to comment.