152 lines
3.7 KiB
JavaScript
152 lines
3.7 KiB
JavaScript
|
export default {
|
||
|
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
|
||
|
ssr: false,
|
||
|
// Learn more about it on https://go.nuxtjs.dev/static-target
|
||
|
target: "static",
|
||
|
|
||
|
router: {
|
||
|
middleware:['auth']
|
||
|
},
|
||
|
|
||
|
|
||
|
// Global page headers: https://go.nuxtjs.dev/config-head
|
||
|
head: {
|
||
|
title: 'Boussole PLUSS',
|
||
|
htmlAttrs: {
|
||
|
lang: 'fr',
|
||
|
},
|
||
|
meta: [
|
||
|
{charset: 'utf-8'},
|
||
|
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
|
||
|
{hid: 'description', name: 'description', content: ''},
|
||
|
{name: 'format-detection', content: 'telephone=no'},
|
||
|
],
|
||
|
link: [{rel: 'icon', href: '/favicon.svg'}],
|
||
|
},
|
||
|
|
||
|
// Global CSS: https://go.nuxtjs.dev/config-css
|
||
|
css: [
|
||
|
// SCSS file in the project
|
||
|
'~/assets/css/main.scss',
|
||
|
'~/assets/css/_color.scss',
|
||
|
'~/assets/css/_font.scss',
|
||
|
'~/assets/css/_spacing.scss'
|
||
|
],
|
||
|
|
||
|
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
|
||
|
plugins: [
|
||
|
{ src: '~/plugins/axios-accessor.ts' },
|
||
|
{ src: '~/plugins/filters.ts' }
|
||
|
],
|
||
|
|
||
|
// Auto import components: https://go.nuxtjs.dev/config-components
|
||
|
components: true,
|
||
|
|
||
|
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
|
||
|
buildModules: [
|
||
|
// https://go.nuxtjs.dev/typescript
|
||
|
'@nuxt/typescript-build',
|
||
|
],
|
||
|
|
||
|
// Modules: https://go.nuxtjs.dev/config-modules
|
||
|
modules: [
|
||
|
// https://go.nuxtjs.dev/axios
|
||
|
'@nuxtjs/axios',
|
||
|
'@nuxtjs/auth-next',
|
||
|
'@nuxtjs/eslint-module',
|
||
|
],
|
||
|
|
||
|
// Axios module configuration: https://go.nuxtjs.dev/config-axios
|
||
|
// axios: {
|
||
|
// // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
|
||
|
// baseURL: '/',
|
||
|
// },
|
||
|
axios: {
|
||
|
baseURL: process.env.BACKEND_BASE_URL || 'http://localhost:8080/'
|
||
|
},
|
||
|
// https://www.wolfpack-digital.com/blogposts/nuxt-auth-refresh-token-authentication-in-your-nuxt-app
|
||
|
// auth: {
|
||
|
// redirect: {
|
||
|
// login: '/login',
|
||
|
// logout: '/',
|
||
|
// home: "/login"
|
||
|
// },
|
||
|
// // localStorage: true,
|
||
|
// // cookie: {
|
||
|
// // prefix: 'auth',
|
||
|
// // options: {
|
||
|
// // path: "/home",
|
||
|
// // maxAge: 1000
|
||
|
// // }
|
||
|
// // },
|
||
|
// strategies: {
|
||
|
// local: {
|
||
|
// token: {
|
||
|
// property: 'token',
|
||
|
// maxAge: 1800,
|
||
|
// global: true
|
||
|
// },
|
||
|
// user: {
|
||
|
// property: false,
|
||
|
// autoFetch: false
|
||
|
// },
|
||
|
// refreshToken: {
|
||
|
// property: 'refreshToken',
|
||
|
// data: 'refresh_token',
|
||
|
// maxAge: 60 * 60 * 24 * 30
|
||
|
// },
|
||
|
// endpoints: {
|
||
|
// login: {url: 'auth/signin', method: 'post' },
|
||
|
// refresh: {url: 'auth/refreshtoken', method: 'post'},
|
||
|
// user: {url: 'auth/me', method: 'get'},
|
||
|
// logout: {url: 'auth/logout', method: 'post'}
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// },
|
||
|
auth:{
|
||
|
redirect:{
|
||
|
login:'/',
|
||
|
logout:'/',
|
||
|
home:"/redirect"
|
||
|
},
|
||
|
localStorage: true,
|
||
|
cookie: {
|
||
|
prefix:'auth',
|
||
|
options:{
|
||
|
path:"/redirect",
|
||
|
maxAge:1000
|
||
|
}
|
||
|
},
|
||
|
strategies:{
|
||
|
local:{
|
||
|
token:{
|
||
|
property:'token',
|
||
|
global:true
|
||
|
},
|
||
|
user:{
|
||
|
property: ''
|
||
|
},
|
||
|
endpoints:{
|
||
|
login: {url: 'auth/signin', method: 'post' },
|
||
|
refresh: {url: 'auth/refreshtoken', method: 'post'},
|
||
|
user: {url: 'auth/me', method: 'get' },
|
||
|
logout: {url: 'auth/logout', method: 'post'}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
|
||
|
// Build Configuration: https://go.nuxtjs.dev/config-build
|
||
|
build: {},
|
||
|
|
||
|
typescript: {
|
||
|
typeCheck: {
|
||
|
eslint: {
|
||
|
files: './**/*.{ts,vue}'
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|