diadal / vue-social-auth

Laravel Vue (SPA) Social Auth
75 stars 27 forks source link

PopUp Window is Not Closing #40

Open Suryadeep-bhujel opened 2 years ago

Suryadeep-bhujel commented 2 years ago

I am using Laravel 8 with Vue2
My Vue Js Code structure is as below
import Vue from 'vue';

import VueRouter from "vue-router";

// Vue.component('loader', require('@imageloader/Loader.vue').default); import loader from '@imageloader/Loader.vue'; import axios from 'axios'; import VueAxios from 'vue-axios' import VueSocialauth from 'vue-social-auth';

const routes = [ { path: '/auth/:provider/callback', component: { template: '

' } }, ]; const router = new VueRouter({ routes, mode: "history", linkActiveClass: "active" }); var x = screen.width / 2 - 700 / 2; var y = (screen.height / 2 - 450 / 2) - 200; // console.log(process.env.MIX_PUSHER_APP_KEY); Vue.use(VueRouter); Vue.use(VueAxios, axios) Vue.use(VueSocialauth, {

providers: { google: { clientId: process.env.MIX_GOOGLE_CLIENT_ID, redirectUri: process.env.MIX_APP_URL + 'social-login/google/callback', // Your client app URL, popupOptions: { width: 552, height: 633, left: x, top: y } }, facebook: { clientId: process.env.MIX_FACEBOOK_CLIENT_ID, redirectUri: process.env.MIX_APP_URL + 'social-login/facebook/callback', // Your client app URL, popupOptions: { width: 552, height: 633, left: x, top: y } } } }) import './components/component'; const app = new Vue({ el: '#app', router,

components: { loader: loader } });

I am successfully getting access into my laravel route and subscribe the user My laravel controller code is as below

**if ($provider == 'twitter') { $user = Socialite::driver('twitter')->user(); } else { $user = Socialite::driver($provider)->stateless()->user(); // dd($user); } $old_user = $this->user->where('email', $user->email)->first(); if($old_user){

        Auth::login($old_user, true);
        Auth::attempt($old_user->toArray());
        Larafirebase::withTitle("Allnepaljob.com Logged In")
        ->withBody("Successfully Logged In")
        ->sendMessage([session()->get('fcm_token')]);
        return response()->json($old_user);

    }**

but my window is not closing

diadal commented 2 years ago

you can use this https://github.com/diadal/universal-social-auth test for vue2. https://github.com/diadal/universal-social-auth-test-vu2