Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Login Pop-up is always blocked #78

Open
edcolmar opened this issue Oct 12, 2016 · 7 comments
Open

Login Pop-up is always blocked #78

edcolmar opened this issue Oct 12, 2016 · 7 comments

Comments

@edcolmar
Copy link

I followed the login process in the readme, but my login popup is always blocked. Is there a workaround/solution?

@edcolmar edcolmar reopened this Oct 12, 2016
@edcolmar
Copy link
Author

edcolmar commented Oct 12, 2016

Still having a hard time with this. In some cases the popup is not blocked, and in others it is. FF seems to be ok with it, but Chrome blocks it, if in incogneto mode, or if using a chrome that has not visited the site already. I am seeing the same behavior on the live demo. Please advise.

@edcolmar
Copy link
Author

There are google auth sites which use the popup, and the popup is not blocked. I know that a user can individually allow popups, but this is unacceptable. Please advise.

@edcolmar
Copy link
Author

Hi Simon

There are google auth sites that use the popup login method, but are not
blocked by chrome.

I know that users can individually disable popup blocking locally, but this
is an unacceptable solution.

Is it possible to bypass the popup blocker by default?

-Ed

On Tue, Oct 25, 2016 at 5:55 AM, Simon Egersand [email protected]
wrote:

This has nothing to do with the component but with the browser. Your
browser are blocking the popup from appearing. Here's some instructions
https://productforums.google.com/forum/#!msg/chrome/m-WfaAOYRyA/lBrW0mIdE5gJ
I found which I think will be helpful.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#78 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzUkzJ2wchhU8zVCRo-XAHHk8TgMMdWks5q3e4WgaJpZM4KUU9D
.

@fernando-lopez
Copy link

Have you seen this FAQ seccion https://github.com/maximepvrt/angular-google-gapi#signup-with-google?

Have you checked the GAuth.login() method is launched by a user action (click) in a HTML element?

We are working in that way, and we have never faced the issue.

If you try to run the GAuth.login() without a user acction, for example when the main page is loading, the popup is blocked.

@edcolmar
Copy link
Author

Thanks for the replies. I've moved on to a different solution.

For other people who may want to use this, can someone update the demo to
show how it should be done?

https://maximepvrt.github.io/angular-google-gapi/#/login

-Ed

On Tue, Nov 22, 2016 at 4:17 AM, Fernando Lopez [email protected]
wrote:

Have you seen this FAQ seccion https://github.com/maximepvrt/
angular-google-gapi#signup-with-google?

Have you checked the GAuth.login() method is launched by a user action
(click) in a HTML element?

We are working in that way, and we have never faced the issue.

If you try to run the GAuth.login() without a user acction, for example
when the main page is loading, the popup is blocked.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#78 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzUk-YYpOsSuzmZ2DVvT2YQRMC7UNgMks5rAs81gaJpZM4KUU9D
.

@dmc31a42
Copy link

dmc31a42 commented Jan 15, 2018

my login page also blocked by popup blocker.
i've seen #68, it said login() must be called directly. but in

load().then(function (){
executeSignin(mode, authorizeCallback);
, when module is not loaded, asynchronous loading happened.
i modify from A: to B: locally and it work i expect
A(original):

else {
  load().then(function (){
    executeSignin(mode, authorizeCallback);
  });
}

B:

else {
  load();
  executeSignin(mode, authorizeCallback);
}

@dmc31a42
Copy link

dmc31a42 commented Jan 15, 2018

or @edcolmar you can try using example code without modify angular-google-gapi.js from:

controller.controller('angular-google-api-example.controller.login', ['$scope', 'GAuth', 'GData', '$state', '$cookies',
function clientList($scope, GAuth, GData, $state, $cookies) {
if(GData.isLogin()){
$state.go('home');
}
var ifLogin = function() {
$cookies.put('userId', GData.getUserId());
$state.go('home');
};
$scope.doLogin = function() {
GAuth.checkAuth().then(
function () {
ifLogin();
},
function() {
GAuth.login().then(function(){
ifLogin();
});
}
);
};
}
])

to:

controller.controller('angular-google-api-example.controller.login', ['$scope', 'GAuth', 'GData', '$state', '$cookies',
    function clientList($scope, GAuth, GData, $state, $cookies) {
    	if(GData.isLogin()){
    		$state.go('home');
    	}
        GAuth.load();

        var ifLogin = function() {
            $cookies.put('userId', GData.getUserId());
            $state.go('home');
        };


        $scope.doLogin = function() {
            GAuth.login().then(function(){
                ifLogin();
            });
        }
    }
])

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants