https://github.com/sirdiego/nuxt-auth-cognito-scheme
Use amazon-cognito-identity-js with the Nuxt.js Auth Module.
https://github.com/sirdiego/nuxt-auth-cognito-scheme
amazon-cognito cognito nuxt-auth nuxtjs
Last synced: about 1 month ago
JSON representation
Use amazon-cognito-identity-js with the Nuxt.js Auth Module.
- Host: GitHub
- URL: https://github.com/sirdiego/nuxt-auth-cognito-scheme
- Owner: sirdiego
- Created: 2020-05-17T08:00:42.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T22:05:20.000Z (almost 2 years ago)
- Last Synced: 2024-04-25T14:22:02.465Z (about 1 year ago)
- Topics: amazon-cognito, cognito, nuxt-auth, nuxtjs
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 14
- Watchers: 2
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @sirdiego/nuxt-auth-cognito-scheme
## Setup
Install with npm:
```bash
npm install --save @sirdiego/nuxt-auth-cognito-scheme
```Install with yarn:
```bash
yarn add @sirdiego/nuxt-auth-cognito-scheme
```Edit `nuxt.config.js`:
```js
{
modules: [
'@nuxtjs/axios',
'@sirdiego/nuxt-auth-cognito-scheme', // Insert before @nuxtjs/auth
'@nuxtjs/auth'
],
auth: {
strategies: {
cognito: {
tokenType: "Bearer",
globalToken: true,
tokenRequired: true,
tokenName: "Authorization",
autoFetchUser: true,
userPoolId: process.env.AWS_COGNITO_USER_POOL_ID,
clientId: process.env.AWS_COGNITO_CLIENT_ID,
refreshInterval: 5 * 60 * 1000, // Set to 0 to disable the browser interval
fetchUserCallback: false // Can be used to put more information into the user object
}
}
}
}
```