Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response code never returned #10

Open
zlayine opened this issue Dec 1, 2021 · 10 comments
Open

Response code never returned #10

zlayine opened this issue Dec 1, 2021 · 10 comments

Comments

@zlayine
Copy link

zlayine commented Dec 1, 2021

Bug
When I try to use the social auth with google, it opens a popup but it redirects to the redirect URI in the popup but never closes the popup or returns the response from where I'm trying to log in

@awsomplak
Copy link

Bug When I try to use the social auth with google, it opens a popup but it redirects to the redirect URI in the popup but never closes the popup or returns the response from where I'm trying to log in

Same Here

@diadal
Copy link
Owner

diadal commented Nov 15, 2022

create the vue route

 {
          path: '/auth/:provider/callback',
          component: {
            template: '<div class="auth-component"></div>'
          }
        },

@bplainia
Copy link

bplainia commented Dec 2, 2022

@diadal Could you put that you must redirect back to the same domain as the UI in the README?
Along with your suggestion above, this worked.

@awsomplak
Copy link

create the vue route

 {
          path: '/auth/:provider/callback',
          component: {
            template: '<div class="auth-component"></div>'
          }
        },

Solved with this
Make laravel socialite redirect to vue path

@lexinzector
Copy link

Solved with this
Make laravel socialite redirect to vue path

but it didn't help me

@lexinzector
Copy link

lexinzector commented Dec 14, 2022

I'm trying to login with facebook.

return redirect('/auth/facebook/callback', 301);

i added this code to Controller. the redirect occurs, but the authorization dialog does not close and when the dialog is forced to close, an error occurs in the console
response Error: Auth popup window closed at index.js:1:10661

debugging output I did via console.log in this vue function

<button @click="useAuthProvider('facebook')">check</button>
useAuthProvider(provider){
	let type = null;
	switch(provider){
		case 'facebook':
			type = Facebook;
			break;
	}
	this.$Oauth.authenticate(provider, type).then((response) => {
		console.log('response', response);
		if(response.code){
			console.log('xxx');
		}
	}).catch((err) => {
		console.log(err);
	})
},

@lexinzector
Copy link

i added console.log code to index.js in this component and got a new error when i try to close the dialog
DOMException: Blocked a frame with origin "https://my-site-url" from accessing a cross-origin frame.

@diadal
Copy link
Owner

diadal commented Dec 15, 2022

you need to add/whitelit the allowed URL in your facebook app

@lexinzector
Copy link

i added all possible url options in my facebook app but it didn't help. what am I doing wrong?

Screenshot_15

Screenshot_16

@lexinzector
Copy link

my problem is solved. my server architecture uses a load balancer. on the main server, the site works via http and on the balancer via https. the backend runs on lumen and accesses social networks via the http protocol. The problem was solved by setting a trusted proxy for lumen. also in the SocialLogin function of the controller, I disabled the redirect to /auth/:provider/callback and replaced it with returning an array of data ({u=>user}) and everything worked

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

No branches or pull requests

5 participants