@adonisjs/ally Twitter compatibility #3498
-
Hi guys 👋 Each time when I try to connect with Twitter, I get an empty authorization url : Here is the code that I use to auth with Twitter : public async twitterRedirection({ ally }: HttpContextContract) {
return ally.use('twitter').redirectUrl();
}
public async twitterCallback({ auth, response, ally }: HttpContextContract) {
const twitter = ally.use('twitter')
// Errors verifications
const twitterUser = await twitter.user()
console.log(twitterUser)
const user = await User.updateOrCreate(
{
email: twitterUser.email!,
},
{
username: twitterUser.name,
loginSource: SocialAccounts.TWITTER,
}
)
const { token } = await auth.use('user').generate(user)
return response.ok({ token })
} Is there a way to use Is there any information that I forgot, that I didn't understand ? Thank you for your help ! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Okay, it looks like that return to frontend the redirect uri to make the redirection self is only possible with Oauth2. |
Beta Was this translation helpful? Give feedback.
-
@Akpagni5547 Have you found any solution for twitter with OAuth2 ? |
Beta Was this translation helpful? Give feedback.
Okay, it looks like that return to frontend the redirect uri to make the redirection self is only possible with Oauth2.