Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitter does not seem to be working #21

Open
whoacowboy opened this issue Jul 10, 2023 · 1 comment
Open

Twitter does not seem to be working #21

whoacowboy opened this issue Jul 10, 2023 · 1 comment

Comments

@whoacowboy
Copy link

Describe the bug
I am unable to log in using Twitter, but the same configuration allows me to log in with Facebook, Google, Discord, Twitch and others.

I get the error message "There is no request token for this page."

ss

config

const options = {
    providers: {
      twitter: {
        url: process.env.TWITTER_URL,
        clientId: process.env.TWITTER_ID,
        redirectUri: process.env.TWITTER_REDIRECT_URI,
      },
    },
  }
  const Oauth = new UniversalSocialauth(axios, options)
  app.config.globalProperties.$Oauth = Oauth
  app.provide('$Oauth', Oauth)

component

import { inject } from 'vue'
import { useStore } from 'vuex'
import { Github, Facebook, Google, Twitter } from 'universal-social-auth'

const Oauth = inject('$Oauth')
const store = useStore()

function useAuthProvider(provider, proData) {
  const pro = proData
  const ProData = pro || Providers[provider]
  Oauth.authenticate(provider, ProData).then((response) => {
    if (response.code) {
      responseData.value.code = response.code
      responseData.value.provider = provider
      store.dispatch('auth/socialLogin', { provider, response })
    }
  }).catch((err) => {})
}

call

@click="useAuthProvider('twitter', Twitter)"
@acabreragnz
Copy link

@whoacowboy you forgot to import Providers

import { Providers } from 'universal-social-auth';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants