Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Social Google Login redirects to customer login screen after Google authentication

    Bug Report
    2
    2
    77
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      CaribGuide last edited by

      Hi,

      I enabled Google social login. I created an app and added ID and secret.
      When I click log in with Google I get redirected to the Google login screen, I log in with Google credentials and then get redirected to the customer login screen.
      The Google app is approved and verified and the redirect URL is correct. The scope of the Google app is correct: ./auth/userinfo.email, ./auth/userinfo.profile and opened.
      There is a piece of code:
      try {
      $user = Socialite::driver($provider)->user();
      } catch (\Exception $e) {
      return redirect()->route('shop.customer.session.index');
      }

      which suggests that the $user assignment failed.

      Please advise.
      Thank you.

      1 Reply Last reply Reply Quote 0
      • Rishabh-Webkul
        Rishabh-Webkul last edited by

        Hello @CaribGuide

        Kindly let me know your bagisto version because this function is updated now with the latest code.

        public function redirectToProvider($provider)
        {
        try {
        return Socialite::driver($provider)->redirect('shop.customers.account.profile.index');
        } catch (\Exception $e) {
        session()->flash('error', $e->getMessage());
        return redirect()->route('shop.customer.session.index');
        }
        }

        GitHub Link:

        https://github.com/bagisto/bagisto/blob/v2.3.0/packages/Webkul/SocialLogin/src/Http/Controllers/LoginController.php

        Regards
        Team Bagisto

        1 Reply Last reply Reply Quote 0
        • First post
          Last post