@things-factory/auth-base 8.0.2 → 8.0.5
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/auth-base",
|
3
|
-
"version": "8.0.
|
3
|
+
"version": "8.0.5",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "dist-client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"passport-jwt": "^4.0.0",
|
47
47
|
"passport-local": "^1.0.0"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "9ab6fca18eeb58b9d2f3411661508a39d0ab6aee"
|
50
50
|
}
|
@@ -18,22 +18,32 @@ const SSOLinks = Object.values(SSOConfig)
|
|
18
18
|
|
19
19
|
export const authSigninRouter = new Router()
|
20
20
|
|
21
|
-
authSigninRouter.get(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
data: {
|
28
|
-
email,
|
29
|
-
redirectTo: redirect_to,
|
30
|
-
ssoLinks: SSOLinks,
|
31
|
-
disableUserSignupProcess,
|
32
|
-
disableUserFavoredLanguage,
|
33
|
-
languages
|
21
|
+
authSigninRouter.get(
|
22
|
+
'/auth/signin',
|
23
|
+
async (ctx, next) => {
|
24
|
+
/* For forward compatibility, cover the case of logging in with username instead of email */
|
25
|
+
if (!ctx.request.body.email && ctx.request.body.username) {
|
26
|
+
ctx.request.body.email = ctx.request.body.username
|
34
27
|
}
|
35
|
-
|
36
|
-
}
|
28
|
+
await next()
|
29
|
+
},
|
30
|
+
async (context, next) => {
|
31
|
+
const { redirect_to, email } = context.query
|
32
|
+
|
33
|
+
await context.render('auth-page', {
|
34
|
+
pageElement: 'auth-signin',
|
35
|
+
elementScript: '/auth/signin.js',
|
36
|
+
data: {
|
37
|
+
email,
|
38
|
+
redirectTo: redirect_to,
|
39
|
+
ssoLinks: SSOLinks,
|
40
|
+
disableUserSignupProcess,
|
41
|
+
disableUserFavoredLanguage,
|
42
|
+
languages
|
43
|
+
}
|
44
|
+
})
|
45
|
+
}
|
46
|
+
)
|
37
47
|
|
38
48
|
authSigninRouter.post('/auth/signin', signinMiddleware, async (context, next) => {
|
39
49
|
const { request, t } = context
|