Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nedevski's avatar

Passport's Authorize redirects to Login page without parameters

I am developing an Action for Google Home with Account Linking on.

This means that when a new user starts my Action, he sees a button to link his Google account with my Laravel app with OAuth. Google provides the /oauth/authorize?lots_of_params link, but when the user hits it, Laravel intercepts it as an unauthorized action, and redirects to /login, losing all of the "lots_of_params" at the end of the URL.

This means that when the users logs in/registers, he is simply redirected to the home page, leaving him wondering what's going on. He is seeing my site in an embed android view and when he closes that view, he sees that the link was not successful.

If the user is already logged in (e.g. he clicks the button again), everything works as expected and he is redirected to the authorize screen in Laravel. My goal is to allow new users to login with Socialite or register, THEN get redirected to that same authorize screen.

My app is basically stock Laravel 5.5 with Socialite (Google, Fb), Passport and 1 API endpoint.

So how should I approach this?

0 likes
0 replies

Please or to participate in this conversation.