Skip to content

Commit 70a4330

Browse files
Updated the authentication flow
1 parent 57218b2 commit 70a4330

File tree

12 files changed

+257
-68
lines changed

12 files changed

+257
-68
lines changed

bin/dep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ rl.question('Your name: ', (name) => {
3838
)
3939
rl.close()
4040
} catch (e) {
41-
console.error(e)
4241
rl.close()
4342
}
4443
})()

ecosystem.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
apps: [
3+
{
4+
name: 'Deployer',
5+
script: 'npm',
6+
args: '-- run start --spa',
7+
watch: false,
8+
exec_mode: 'cluster',
9+
instances: 1,
10+
},
11+
],
12+
}

layouts/default.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
<p class="caption mt-1">
3333
{{ $auth.user.email }}
3434
</p>
35-
<v-divider class="my-3" />
36-
<v-btn to="/" depressed rounded text> Home </v-btn>
37-
<v-divider class="my-3" />
3835
<v-btn to="/home" depressed rounded text> My account </v-btn>
3936
<v-divider class="my-3" />
4037
<v-btn
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<template>
2-
<h1>Deployer</h1>
2+
<nuxt />
33
</template>

layouts/error.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
2-
<v-app dark>
3-
<h1 v-if="error.statusCode === 404">
4-
{{ pageNotFound }}
5-
</h1>
6-
<h1 v-else>
7-
{{ otherError }}
8-
</h1>
9-
<NuxtLink to="/"> Home page </NuxtLink>
2+
<v-app dark class="full-page">
3+
<div v-if="error.statusCode === 404">
4+
<v-img contain height="400" src="/404.svg" />
5+
</div>
6+
<div v-else>
7+
<v-img src="/500.svg" />
8+
</div>
9+
<NuxtLink to="/home"> Home page </NuxtLink>
1010
</v-app>
1111
</template>
1212

@@ -39,4 +39,11 @@ export default {
3939
h1 {
4040
font-size: 20px;
4141
}
42+
.full-page {
43+
height: 100vh;
44+
display: flex;
45+
flex-direction: column;
46+
align-items: center;
47+
justify-content: center;
48+
}
4249
</style>

nuxt.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ export default {
4141
css: ['~/assets/prism.css'],
4242

4343
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
44-
plugins: ['~/plugins/vee-validate.js', '~/plugins/prism.js'],
44+
plugins: [
45+
'~/plugins/vee-validate.js',
46+
'~/plugins/prism.js',
47+
'~/plugins/axios.js',
48+
],
4549

4650
// Auto import components: https://go.nuxtjs.dev/config-components
4751
components: true,
@@ -98,6 +102,12 @@ export default {
98102
* Auth configuration
99103
*/
100104
auth: {
105+
redirect: {
106+
login: '/login',
107+
logout: '/login',
108+
callback: '/login',
109+
home: '/home',
110+
},
101111
strategies: {
102112
cookie: {
103113
user: {

package-lock.json

Lines changed: 103 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"express-session": "^1.17.2",
2626
"mevn-orm": "^2.2.1",
2727
"morgan": "^1.10.0",
28-
"mysql2": "^2.2.5",
28+
"mysql": "^2.18.1",
2929
"nuxt": "^2.15.8",
3030
"redis": "^3.1.2",
3131
"sessionstore": "^1.3.7",

0 commit comments

Comments
 (0)