forked from lix-project/hydra
Use new Google for Web signin, the old way will be deprecated Mar 31st 2023
This commit is contained in:
parent
ecfa817d30
commit
f88bef15ed
|
@ -82,7 +82,7 @@
|
||||||
function onGoogleSignIn(googleUser) {
|
function onGoogleSignIn(googleUser) {
|
||||||
requestJSON({
|
requestJSON({
|
||||||
url: "[% c.uri_for('/google-login') %]",
|
url: "[% c.uri_for('/google-login') %]",
|
||||||
data: "id_token=" + googleUser.getAuthResponse().id_token,
|
data: "id_token=" + googleUser.credential,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
@ -91,9 +91,6 @@
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$("#google-signin").click(function() {
|
|
||||||
$(".g-signin2:first-child > div").click();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
|
|
|
@ -133,8 +133,10 @@
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
[% WRAPPER makeSubMenu title="Sign in" id="sign-in-menu" align="right" %]
|
[% WRAPPER makeSubMenu title="Sign in" id="sign-in-menu" align="right" %]
|
||||||
[% IF c.config.enable_google_login %]
|
[% IF c.config.enable_google_login %]
|
||||||
<div style="display: none" class="g-signin2" data-onsuccess="onGoogleSignIn" data-theme="dark"></div>
|
<script src="https://accounts.google.com/gsi/client" async defer></script>
|
||||||
<a class="dropdown-item" href="#" id="google-signin">Sign in with Google</a>
|
<div id="g_id_onload" data-client_id="[% c.config.google_client_id %]" data-callback="onGoogleSignIn">
|
||||||
|
</div>
|
||||||
|
<div class="g_id_signin" data-type="standard"></div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF c.config.github_client_id %]
|
[% IF c.config.github_client_id %]
|
||||||
|
|
Loading…
Reference in a new issue