Auth-module: [Question] Extending this to work with social login

Created on 12 Nov 2017  路  15Comments  路  Source: nuxt-community/auth-module

How would you extend this to allow Facebook/Google authentication?

This question is available on Nuxt.js community (#c9)
implemented

Most helpful comment

@nikkanetiya remember you have to considerate the SSR, also you have to keep the current user/password login functionality working

I'm about to start the Google/Facebook login integration, I hope to make the contribution for this library

All 15 comments

@Syffs maybe hello.js will be simplest & effective solution, or anyone has a better suggestion?

@nikkanetiya remember you have to considerate the SSR, also you have to keep the current user/password login functionality working

I'm about to start the Google/Facebook login integration, I hope to make the contribution for this library

I'd like to know this as well. I have things ready to work with Express + Passport.js but I don't see how I could wrap it with this package.

Thanks for developping this! I think that's one of the big thing that nuxt was missing!

Any ETA for the 4.0?

@Syffs You can follow the development here

@breakingrobot That's great news. I love how this package works, it will be awesome having social integration as well. Please keep us posted!

Hello @nikkanetiya
I tried to implement the Social Login in the library but I have seen that many changes had to be made, for the moment what I have done is access to social networks outside the library and then set the Store like this

this.$store.dispatch('auth/updateToken', response.data.token)
this.$store.commit('auth/SET_USER', user.data)

I am glad that the developers have decided to implement it, I will follow the trail.

Thank you @breakingrobot @pi0

Hello @epartipilo
What I am doing right at moment is do social login with HelloJs and then pass the social data with user data for login like

this.$store.dispatch('auth/login', data)

anyone else have better way to doing the same.

I've extended this module to handle social authentication on server-side. This is a better approach in my case rather than handling oauth connections on client-side.

If it's useful to anyone else, I could PR.

@Syffs Yes. PRs welcome :)

handle social authentication on server-side

Do you mean API scheme?

Do you mean API scheme?

@pi0 exactly, I'm opened to suggestion on the naming.

I think oauth scheme is perfect when you don't need a backend, but when you do, external authorization & tokens are better handled on server-side

@Syffs so why don't we extend local scheme's functionality? Would you please DM me your email? (pyapar at gmail dot coom)

@Syffs that would be awesome. If that's not too much to ask, please leave a functional usage example if the PR gets merged 馃槃

@pi0 ofc, I'll send you a mail! The flow I've implemented is a bit different from local: it uses jwt, but the token is provided to the client through a callback (as in oauth scheme).
Also, I did like the idea of not breaking local scheme and keeping it simple for user/pass auth. But then it depends on how you'd extend it

@sergiocastrovale if you can fill some facebook/google app id/secret, this example does work

This is done as of 4.0 馃巻 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

roosht3 picture roosht3  路  3Comments

manniL picture manniL  路  4Comments

Amoki picture Amoki  路  3Comments

amjadkhan896 picture amjadkhan896  路  3Comments

weijinnx picture weijinnx  路  3Comments