@semapps/auth 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mixins/auth.sso.js +2 -0
- package/package.json +4 -4
- package/services/auth.local.js +6 -1
package/mixins/auth.sso.js
CHANGED
@@ -69,6 +69,7 @@ const AuthSSOMixin = {
|
|
69
69
|
return [
|
70
70
|
{
|
71
71
|
path: '/auth',
|
72
|
+
name: 'auth',
|
72
73
|
use: [sessionMiddleware, this.passport.initialize(), this.passport.session()],
|
73
74
|
aliases: {
|
74
75
|
'GET /': [saveRedirectUrl, this.passport.authenticate(this.passportId, { session: false }), redirectToFront]
|
@@ -76,6 +77,7 @@ const AuthSSOMixin = {
|
|
76
77
|
},
|
77
78
|
{
|
78
79
|
path: '/auth/logout',
|
80
|
+
name: 'auth-logout',
|
79
81
|
use: [sessionMiddleware, this.passport.initialize(), this.passport.session()],
|
80
82
|
aliases: {
|
81
83
|
'GET /': [saveRedirectUrl, localLogout, redirectToFront]
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@semapps/auth",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.1",
|
4
4
|
"description": "Authentification module for SemApps",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"author": "Virtual Assembly",
|
7
7
|
"dependencies": {
|
8
|
-
"@semapps/mime-types": "0.4.
|
9
|
-
"@semapps/triplestore": "0.4.
|
8
|
+
"@semapps/mime-types": "0.4.1",
|
9
|
+
"@semapps/triplestore": "0.4.1",
|
10
10
|
"bcrypt": "^5.0.1",
|
11
11
|
"express-session": "^1.17.0",
|
12
12
|
"jsonwebtoken": "^8.5.1",
|
@@ -25,5 +25,5 @@
|
|
25
25
|
"publishConfig": {
|
26
26
|
"access": "public"
|
27
27
|
},
|
28
|
-
"gitHead": "
|
28
|
+
"gitHead": "c7bfdbca325796fa4627882ea9e21616a97b39a9"
|
29
29
|
}
|
package/services/auth.local.js
CHANGED
@@ -69,7 +69,7 @@ const AuthLocalService = {
|
|
69
69
|
|
70
70
|
const token = await ctx.call('auth.jwt.generateToken', { payload: { webId: accountData.webId } });
|
71
71
|
|
72
|
-
return { token, webId: accountData.webId, newUser:
|
72
|
+
return { token, webId: accountData.webId, newUser: false };
|
73
73
|
},
|
74
74
|
async resetPassword(ctx) {
|
75
75
|
const { email } = ctx.params;
|
@@ -123,6 +123,7 @@ const AuthLocalService = {
|
|
123
123
|
getApiRoutes() {
|
124
124
|
const loginRoute = {
|
125
125
|
path: '/auth/login',
|
126
|
+
name: 'auth-login',
|
126
127
|
use: [this.passport.initialize()],
|
127
128
|
aliases: {
|
128
129
|
'POST /': [this.passport.authenticate(this.passportId, { session: false }), sendToken]
|
@@ -131,6 +132,7 @@ const AuthLocalService = {
|
|
131
132
|
|
132
133
|
const signupRoute = {
|
133
134
|
path: '/auth/signup',
|
135
|
+
name: 'auth-signup',
|
134
136
|
aliases: {
|
135
137
|
'POST /': 'auth.signup'
|
136
138
|
}
|
@@ -138,12 +140,14 @@ const AuthLocalService = {
|
|
138
140
|
|
139
141
|
const resetPasswordRoute = {
|
140
142
|
path: '/auth/reset_password',
|
143
|
+
name: 'auth-reset-password',
|
141
144
|
aliases: {
|
142
145
|
'POST /': 'auth.resetPassword'
|
143
146
|
}
|
144
147
|
};
|
145
148
|
const setNewPasswordRoute = {
|
146
149
|
path: '/auth/new_password',
|
150
|
+
name: 'auth-new-password',
|
147
151
|
aliases: {
|
148
152
|
'POST /': 'auth.setNewPassword'
|
149
153
|
}
|
@@ -151,6 +155,7 @@ const AuthLocalService = {
|
|
151
155
|
|
152
156
|
const accountSettingsRoute = {
|
153
157
|
path: '/auth/account',
|
158
|
+
name: 'auth-account',
|
154
159
|
aliases: {
|
155
160
|
'GET /': 'auth.account.findSettingsByWebId',
|
156
161
|
'POST /': 'auth.account.updateAccountSettings'
|