miolo 3.0.0-beta.200 → 3.0.0-beta.202
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
package/src/config/defaults.mjs
CHANGED
|
@@ -390,7 +390,7 @@ export default function make_config_defaults() {
|
|
|
390
390
|
// err => done(error, null)
|
|
391
391
|
// local_url_login : '/login',
|
|
392
392
|
// local_url_logout: '/logout',
|
|
393
|
-
// local_url_login_redirect:
|
|
393
|
+
// local_url_login_redirect: '/
|
|
394
394
|
// local_url_logout_redirect: '/'
|
|
395
395
|
// google_auth_user: (accessToken, refreshToken, profile, done, ctx) => done(null, {id: 1})
|
|
396
396
|
// auth => done(null, user)
|
|
@@ -247,9 +247,18 @@ const init_passport_auth_middleware = (app, options, sessionConfig, cacheConfig)
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
// handle auth routes
|
|
250
|
-
const handleGoogleLogin =
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
const handleGoogleLogin = (ctx, next) => {
|
|
251
|
+
ctx.miolo.logger.debug(`[auth][google] handleGoogleLogin() - authenticating...`)
|
|
252
|
+
|
|
253
|
+
const redirectUrl = ctx.query.redirect || "/"
|
|
254
|
+
|
|
255
|
+
const strategy = passport.authenticate("google", {
|
|
256
|
+
scope: ["profile", "email"],
|
|
257
|
+
state: redirectUrl
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
return strategy(ctx, next)
|
|
261
|
+
}
|
|
253
262
|
|
|
254
263
|
const handleGoogleCallback = (ctx, next) => {
|
|
255
264
|
ctx.miolo.logger.debug(`[auth][google] handleGoogleCallback() - authenticating...`)
|
|
@@ -284,15 +293,19 @@ const init_passport_auth_middleware = (app, options, sessionConfig, cacheConfig)
|
|
|
284
293
|
ctx.session.authenticated = true
|
|
285
294
|
ctx.session.auth_method = "google"
|
|
286
295
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
296
|
+
ctx.body = {
|
|
297
|
+
ok: true,
|
|
298
|
+
data: {
|
|
299
|
+
user: user,
|
|
300
|
+
authenticated: true,
|
|
301
|
+
config: {
|
|
302
|
+
auth_method: "google"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
294
306
|
|
|
295
|
-
ctx.
|
|
307
|
+
const redirectUrl = ctx.query.state || google_url_login_redirect || "/"
|
|
308
|
+
ctx.redirect(redirectUrl)
|
|
296
309
|
}
|
|
297
310
|
})(ctx, next)
|
|
298
311
|
}
|
package/template/package.json
CHANGED
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"intre": "^3.0.0-beta.4",
|
|
46
46
|
"joi": "^18.2.1",
|
|
47
47
|
"lucide-react": "^1.16.0",
|
|
48
|
-
"miolo-cli": "^3.0.0-beta.
|
|
48
|
+
"miolo-cli": "^3.0.0-beta.202",
|
|
49
49
|
"miolo-model": "file:../miolo-model",
|
|
50
|
-
"miolo-react": "^3.0.0-beta.
|
|
50
|
+
"miolo-react": "^3.0.0-beta.202",
|
|
51
51
|
"next-themes": "^0.4.6",
|
|
52
52
|
"radix-ui": "^1.4.3",
|
|
53
53
|
"react": "^19.2.6",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@biomejs/biome": "2.4.15",
|
|
65
|
-
"miolo": "^3.0.0-beta.
|
|
65
|
+
"miolo": "^3.0.0-beta.202",
|
|
66
66
|
"sass-embedded": "^1.99.0"
|
|
67
67
|
},
|
|
68
68
|
"overrides": {
|