https://github.com/netsells/nuxt-auth
Enhanced @nuxtjs/auth module with runtime config
https://github.com/netsells/nuxt-auth
Last synced: 30 days ago
JSON representation
Enhanced @nuxtjs/auth module with runtime config
- Host: GitHub
- URL: https://github.com/netsells/nuxt-auth
- Owner: netsells
- Created: 2021-02-24T10:02:31.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-12T09:39:00.000Z (about 2 years ago)
- Last Synced: 2025-03-24T20:11:20.484Z (about 2 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @netsells/nuxt-auth
This package simply builds on the official `@nuxtjs/auth` module, and adds in runtime config functionality.
**NOTE:** This package has been updated for v5 of the `@nuxtjs/auth` module, for `@nuxtjs/auth` v4 compatibility, check out version 1.x.
## Installation
```sh
$ yarn add -D @netsells/nuxt-auth
```## Usage
### Setup
Add the module to your nuxt config:
```js
module.exports = {
modules: [
'@netsells/nuxt-auth',
],
};
```### Runtime Config
You can then define your config in your `publicRuntimeConfig` and `privateRuntimeConfig` respectively. The config follows the same structure as the config you would provide to the module directly, but nested under the `auth` key. For example:
```js
module.exports = {
publicRuntimeConfig: {
auth: {
strategies: {
local: {
endpoints: {
login: {
url: `${ process.env.APP_URL }/api/auth/login`,
},
},
},
},
},
},
};
```Any values in here will be merged with the config passed to the `@nuxtjs/auth` module.