'Google Login with Laravel

In my website I have a candidate account and a Employer account.

I want to add google login for both users. Both have different controller methods and routes.

Google login for candidate is working but google login with employer saying redirect URI mismatch.

In my google console I have add two redirect URI's one for candidate and one for employer.

My question is is it possible to have multiple redirect uri in .env

My .env looks like :

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_URL=http://www.theunitedjobs.com/login/jobseeker/google/callback

But I want to add two google_url want to add this also :

GOOGLE_URL=http://theunitedjobs.com/login/employer/google/callback

So is it possible to add two redirect URI's???



Solution 1:[1]

Rather than use a login_uri parameter for your google login markup , you can use data-callback and check in the function on which route you want to send the route to.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhammad Taha