Skip to content

Commit e722512

Browse files
committed
Add Oauth
1 parent de6b9b8 commit e722512

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

_layouts/default.html

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,13 @@
2929
responseType: 'token id_token'
3030
});
3131

32-
33-
function login() {
34-
webAuth.authorize();
35-
}
32+
logout = () => webAuth.logout({
33+
returnTo: 'https://' +window.location.hostname + '/'
34+
});
3635

3736
$(document).ready(function() {
3837

39-
$(".login-btn").click(() => {
40-
webAuth.authorize();
41-
return false;
42-
});
43-
$(".logout-btn").click(() => webAuth.logout({
44-
returnTo: 'https://' +window.location.hostname + '/'
45-
}));
46-
38+
4739
webAuth.checkSession(
4840
{
4941
audience: `https://coderic.eu.auth0.com/api/v2/`,

_layouts/layout_en.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
</ol>
5353
<ol class="inline-flex md:space-x-2 rtl:space-x-reverse guest">
5454
<li>
55-
<a class="btn-login inline-flex items-center text-sm font-medium hover:text-orange-600"
56-
title="Log in">
55+
<a class="inline-flex items-center text-sm font-medium hover:text-orange-600"
56+
title="Log in" onclick="webAuth.authorize(); return false;">
5757
<svg class="w-3.5 h-3.5 ms-2 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"
5858
fill="currentColor">
5959
<defs />
@@ -99,7 +99,7 @@
9999
</a>
100100
</li>
101101
<li>
102-
<button type="submit" class="inline-flex logout-btn items-center text-sm font-medium hover:text-orange-600">
102+
<button type="submit" onclick="logout()" class="inline-flex items-center text-sm font-medium hover:text-orange-600">
103103
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
104104
stroke="currentColor" class="w-3.5 h-3.5 ms-2 mr-2">
105105
<path stroke-linecap="round" stroke-linejoin="round"

0 commit comments

Comments
 (0)