diadal / universal-social-auth

SPA universal social auth
MIT License
40 stars 11 forks source link

Reference Error self is not defined #13

Closed ibraahim6 closed 1 year ago

ibraahim6 commented 1 year ago

Hello, i use your package in nuxt app with version vue2 and this error will showning with me please any solation?? image

ibraahim6 commented 1 year ago

this my file plugin to use your package...

`// import Vue from 'vue' import axios from 'axios' import UniversalSocialauth from 'universal-social-auth'

// Vue.config.productionTip = false

const options = { providers: { // apple: { // nonce: '', // state: '', // clientId: '', // redirectUri: 'https://myapp.com/auth/github/callback' // }, // github: { // clientId: '', // redirectUri: 'https://diadal.com.ng/auth/github/callback' // }, // twitch: { // clientId: ', // redirectUri: 'https://diadal.com.ng/auth/twitch/callback' // }, google: { clientId: '', redirectUri: 'http://localhost:3000/auth/google/callback' }, // facebook: { // clientId: '', // redirectUri: 'https://myapp.com/auth/facebook/callback' // }, // twitter: { // url: 'https://myapp.com/auth/twitter', // clientId: '****', // redirectUri: 'https://myapp.com/auth/twitter/callback' // } } }

const Oauth = new UniversalSocialauth(axios, options)

// Vue.prototype.$axios = axios // Vue.prototype.$Oauth = Oauth

export default Oauth;`

diadal commented 1 year ago

check this tut https://github.com/diadal/universal-social-auth-test-nuxt

ibraahim6 commented 1 year ago

i check it by my self and the issue still exists

ibraahim6 commented 1 year ago

and i use nuxt with javascript .. i checked this your repo => https://github.com/diadal/universal-social-auth-test-nuxt-js

ZajdeR commented 1 year ago

The issue on SSR mode is only when passing providerData. You can add it as object. I use the same that are in repo, then problem is solved.

jawainc commented 1 year ago

@ZajdeR having same problem on nuxt 2 can you explain passing providerData as object by example

diadal commented 1 year ago

@ZajdeR having same problem on nuxt 2 can you explain passing providerData as object by example

you do not need to import the providerData simply create the data object and use