Nuxt.js: [Question] Nuxt way for local and social authentication

Created on 12 Nov 2017  路  8Comments  路  Source: nuxt/nuxt.js

I have 2 options in mind:

  1. setting up my own oauth2 server with oauth2orize, but it seems a bit overkill and I'm still a bit lost on how to set this up

  2. Performing initial auth with passport-local/passport-facebook to issue a jwt used to authenticate each request with passport-http-bearer

I'm really wondering what is recommended with Nuxt?

This question is available on Nuxt.js community (#c1850)
help-wanted

Most helpful comment

@renztoygwapo @clarkdo I implemented this based on auth-module refactoring from @pi0

IMO, at the moment it's only ok for prototyping as auth-module still presents some issues (client-side cookies, token expiration, etc...)

All 8 comments

any feeback on this one ?

@Syffs @renztoygwapo
Really sorry for the late reply.

I am not an expert in social auth, but you may have a look at:
https://github.com/nuxt-community/auth-module/tree/dev/examples/demo
https://github.com/tomgreener/nuxt-passport-facebook-authentication

If the repos don't solve your problem, maybe @pi0 can help you on this issue.

@renztoygwapo @clarkdo I implemented this based on auth-module refactoring from @pi0

IMO, at the moment it's only ok for prototyping as auth-module still presents some issues (client-side cookies, token expiration, etc...)

awesome., I will try this :)

So I will close this issue, but if you have any further questions, feel free to leave comments here. 馃樃

I @Syffs I tried to cloned it, but it doesnt run well there is an issue on bootstrap-vue ?

Does it need a nuxt applications and will just import it via module ? or it will run sttandalone ?
if so, how I can import it ?
here;s the error.
image

@renztoygwapo what did you do exactly?
I've just tried this

git clone [email protected]:Syffs/auth-module.git
git checkout api-auth
yarn
yarn dev

result looks good:

yarn run v1.5.1
$ nodemon --watch api --exec "nuxt examples/demo"
[nodemon] 1.17.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: api
[nodemon] starting `nuxt examples/demo`
[HPM] Proxy created: /api  ->  http://localhost:3000
  nuxt:axios BaseURL: http://localhost:3000/ (Browser: /) +0ms
  nuxt:build App root: /home/syffs/WebstormProjects/auth-module/examples/demo +0ms
  nuxt:build Generating /home/syffs/WebstormProjects/auth-module/.nuxt files... +1ms
  nuxt:build Generating files... +53ms
  nuxt:build Generating routes... +8ms
  nuxt:build Building files... +42ms
  nuxt:build Adding webpack middleware... +895ms
  鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅 100% 

Build completed in 6.237s



 DONE  Compiled successfully in -4758ms                                                                                                                                                             19:30:54


 OPEN  http://localhost:3000

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maicong picture maicong  路  3Comments

bimohxh picture bimohxh  路  3Comments

VincentLoy picture VincentLoy  路  3Comments

vadimsg picture vadimsg  路  3Comments

vadimsg picture vadimsg  路  3Comments