auth-module icon indicating copy to clipboard operation
auth-module copied to clipboard

Questions about cognito authentication with nuxt2 + nuxt-auth + aws-amplify

Open youngseo-im opened this issue 2 years ago • 2 comments

I'm using cognito and nuxt-auth in a nuxt2 project

I want to apply a custom UI instead of the login UI provided by AWS, so I implemented login using aws-apmlify package, but the token is not renewed, how should I configure nuxt.config.js?

I didn't configure amplify with the CLI because it only requires authentication during the aws-amplify service.

// current nuxt.config.js 스크린샷 2023-05-16 18 49 51

// current Login Page 스크린샷 2023-05-16 18 51 05

// Request URL and error message 스크린샷 2023-05-16 18 56 07 스크린샷 2023-05-16 18 55 09 스크린샷 2023-05-16 19 00 40

youngseo-im avatar May 16 '23 09:05 youngseo-im

Sorry, I'll edit the question.

After modifying the settings in nuxt.config.js like this, I don't get the error I posted above. Instead, it doesn't renew the token when it expires, what should I do?

스크린샷 2023-05-17 10 34 10

youngseo-im avatar May 17 '23 01:05 youngseo-im

Hi!

Take a look at this scheme https://auth.nuxtjs.org/schemes/refresh I believe it's because the local scheme does not implement a refresh logic. Also by looking at endpoints, it does not have a configuration for the refresh endpoint.

However looking at the endpoints, it seems like oauth2 which would be https://auth.nuxtjs.org/schemes/oauth2

If you have to implement your own strategy there is documentation for this as well https://auth.nuxtjs.org/guide/scheme#creating-your-own-scheme

Henrikrb avatar May 24 '23 14:05 Henrikrb