DEV Community

Discussion on: Adding Authentication to a Nuxt App with AWS Amplify

Collapse
 
aossey profile image
Michael Aossey

Hi @dabit3 ,
Thank you for the contribution, there is not a lot of info out there on nuxt and Amplify.

I wanted to point out a few things to help improve this for others:

As @arunans23 pointed out - npm install should be

npm install aws-amplify @aws-amplify/ui-vue
Enter fullscreen mode Exit fullscreen mode

In profile\amplify.js file, the aws-exports.js file should import with path ~/aws-exports since there is no src directory in nuxt

The plugin also needs to be added to nuxt-config.js in the plugins array as client-only by adding

{ src: '~/plugins/amplify.js', mode: 'client' }
Enter fullscreen mode Exit fullscreen mode

The profile file should be in the pages directory and call profile.vue rather than profile.js

Collapse
 
saunved profile image
Saunved

Hi, do you have any resources that could help me setup Amplify with an existing auth configuration? I created an amplify plugin file (docs.amplify.aws/lib/auth/start/q/...) and added it to nuxt.config.js, but I get this error:

AuthError - 
Error: Amplify has not been configured correctly. 
The configuration object is missing required auth properties.
Enter fullscreen mode Exit fullscreen mode

Just wondering in case you have any experience with this.