From 5840a4ecd78746f21ed770f7cb15fee46b2a25d4 Mon Sep 17 00:00:00 2001 From: Eiji Kitamura Date: Mon, 21 Nov 2016 17:09:08 +0900 Subject: [PATCH 1/2] Defer init when client_id is directly added. --- google-signin-aware.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/google-signin-aware.html b/google-signin-aware.html index 0b86a17..e0c6b00 100644 --- a/google-signin-aware.html +++ b/google-signin-aware.html @@ -61,7 +61,9 @@ } if (val && val != this._clientId) { this._clientId = val; - this.initAuth2(); + if ('gapi' in window) { + this.initAuth2(); + } } }, From 372a79717dcdfda4763d36a857613754f0727720 Mon Sep 17 00:00:00 2001 From: Eiji Kitamura Date: Mon, 21 Nov 2016 19:10:56 +0900 Subject: [PATCH 2/2] Support `login_hint` feature --- google-signin-aware.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/google-signin-aware.html b/google-signin-aware.html index e0c6b00..154c920 100644 --- a/google-signin-aware.html +++ b/google-signin-aware.html @@ -425,10 +425,11 @@ }, /** pops up sign-in dialog */ - signIn: function() { + signIn: function(id) { this.assertAuthInitialized(); var params = { - 'scope': this.getMissingScopes() + 'scope': this.getMissingScopes(), + 'login_hint': id || '' }; // Proxy specific attributes through to the signIn options. @@ -729,8 +730,8 @@ }, /** pops up the authorization dialog */ - signIn: function() { - AuthEngine.signIn(); + signIn: function(id) { + AuthEngine.signIn(id); }, /** signs user out */