0.0.2 • Published 3 years ago
@deegital/nuxt-trustup-io-auth v0.0.2
nuxt-trustup-io-auth
Nuxt module for auth
Quick Setup
- Add
@deegital/nuxt-trustup-io-authdependency to your project
# Using pnpm
pnpm add -D @deegital/nuxt-trustup-io-auth
# Using yarn
yarn add --dev @deegital/nuxt-trustup-io-auth
# Using npm
npm install --save-dev @deegital/nuxt-trustup-io-auth- Add
@deegital/nuxt-trustup-io-authto themodulessection ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
'@deegital/nuxt-trustup-io-auth'
],
trustupIoAuth: {}
})Usage/Examples
NUXT_PUBLIC_AUTH_TRUSTUP_IO_URL=https://auth.trustup.ioexport default defineNuxtConfig({
runtimeConfig: {
public: {
authTrustupIoUrl: "",
},
},
...
trustupIoAuth: {
localStorageKey: "auth_token", // the name of the key for the token, 'auth_token by default'
},
...In your app.vue you should use the layout to have the loader and hide if not authenticated
<template>
<div>
<h1>App</h1>
<div>
<NuxtLayout name="auth-layout">
<NuxtPage />
</NuxtLayout>
</div>
</div>
</template>If you want to display the user informations you can use the composable useAuth()
const auth = useAuth();
console.log(auth.user);That's it! You can now use nuxt-trustup-io-auth in your Nuxt app ✨
Development
Bootstrap module
Find and replace all on all files (CMD+SHIFT+F):
- nuxt-trustup-io-auth // nuxt-trustup-io-toasteo
- Nuxt module for auth // Our notification package for nuxt.
- trustupIoAuth // trustupIoToasteo
- @deegital // @deegital
- git@github.com:deegitalbe/nuxt-trustup-io-auth.git // git@github.com:deegitalbe/nuxt-trustup-io-toasteo.gitStart bootstrap script
./cli bootstrapAvailable commands
# Install dependencies
./cli yarn install
# Generate playground
./cli yarn generate
# Start project
./cli start
# Stop project
./cli stop
# Restart project
./cli restart
# Build the playground for production
./cli yarn dev:build
# Run ESLint
./cli yarn lint
# Run Vitest
./cli yarn test
./cli yarn test:watch
# Validate your package (running linter & typecript validation)
./cli yarn validate
# Build the package for publication
./cli yarn build
# Release new version
npm version patchReferences
Nuxt module development reference
1.2.3
2 years ago
1.3.1
2 years ago
1.2.2
2 years ago
1.3.0
2 years ago
1.2.0
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.0
2 years ago
1.2.1
2 years ago
1.1.2
2 years ago
0.0.13
3 years ago
0.0.12
3 years ago
0.0.11
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago