strapi-custom-auth 1.2.28 → 1.2.29
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/dist/server/index.js +7 -11
- package/dist/server/index.mjs +7 -11
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -3392,7 +3392,6 @@ async function microsoftLogout(ctx) {
|
|
|
3392
3392
|
async function microsoftTokenRenewal(ctx) {
|
|
3393
3393
|
const userService = strapi.service("admin::user");
|
|
3394
3394
|
const tokenService = strapi.service("admin::token");
|
|
3395
|
-
const tokenService2 = strapi.service("admin.token");
|
|
3396
3395
|
const config2 = configValidation();
|
|
3397
3396
|
const { body } = ctx.request;
|
|
3398
3397
|
const params = new URLSearchParams();
|
|
@@ -3416,24 +3415,21 @@ async function microsoftTokenRenewal(ctx) {
|
|
|
3416
3415
|
}
|
|
3417
3416
|
});
|
|
3418
3417
|
const { mail } = userResponse?.data;
|
|
3418
|
+
console.log("----mail----", mail);
|
|
3419
3419
|
const dbUser = await userService.findOneByEmail(mail);
|
|
3420
3420
|
const jwtToken = await tokenService.createToken(dbUser);
|
|
3421
3421
|
console.log("----tokenService----", tokenService);
|
|
3422
|
-
console.log("----tokenService----", JSON.stringify(tokenService));
|
|
3423
|
-
console.log("----tokenService2----", tokenService2);
|
|
3424
|
-
console.log("----tokenService2----", JSON.stringify(tokenService2));
|
|
3425
3422
|
try {
|
|
3426
|
-
|
|
3423
|
+
console.log("----dbUser----", dbUser);
|
|
3424
|
+
console.log("----dbUser----", JSON.stringify(dbUser));
|
|
3425
|
+
const jwtToken2 = strapi.plugins["users-permissions"].services.jwt.issue({
|
|
3426
|
+
id: dbUser.id
|
|
3427
|
+
});
|
|
3427
3428
|
console.log("----jwtToken2----", jwtToken2);
|
|
3429
|
+
console.log("----jwtToken2----", JSON.stringify(jwtToken2));
|
|
3428
3430
|
} catch (e2) {
|
|
3429
3431
|
console.log("----jwtToken2----, e", JSON.stringify(e2));
|
|
3430
3432
|
}
|
|
3431
|
-
try {
|
|
3432
|
-
const jwtToken3 = await tokenService2.createToken(dbUser);
|
|
3433
|
-
console.log("----jwtToken3----", jwtToken3);
|
|
3434
|
-
} catch (e2) {
|
|
3435
|
-
console.log("----jwtToken3----, e", JSON.stringify(e2));
|
|
3436
|
-
}
|
|
3437
3433
|
return ctx.send({ accessToken: jwtToken, refreshToken: tokenResponse.data.refresh_token });
|
|
3438
3434
|
} catch (e2) {
|
|
3439
3435
|
console.error(e2.message);
|
package/dist/server/index.mjs
CHANGED
|
@@ -3377,7 +3377,6 @@ async function microsoftLogout(ctx) {
|
|
|
3377
3377
|
async function microsoftTokenRenewal(ctx) {
|
|
3378
3378
|
const userService = strapi.service("admin::user");
|
|
3379
3379
|
const tokenService = strapi.service("admin::token");
|
|
3380
|
-
const tokenService2 = strapi.service("admin.token");
|
|
3381
3380
|
const config2 = configValidation();
|
|
3382
3381
|
const { body } = ctx.request;
|
|
3383
3382
|
const params = new URLSearchParams();
|
|
@@ -3401,24 +3400,21 @@ async function microsoftTokenRenewal(ctx) {
|
|
|
3401
3400
|
}
|
|
3402
3401
|
});
|
|
3403
3402
|
const { mail } = userResponse?.data;
|
|
3403
|
+
console.log("----mail----", mail);
|
|
3404
3404
|
const dbUser = await userService.findOneByEmail(mail);
|
|
3405
3405
|
const jwtToken = await tokenService.createToken(dbUser);
|
|
3406
3406
|
console.log("----tokenService----", tokenService);
|
|
3407
|
-
console.log("----tokenService----", JSON.stringify(tokenService));
|
|
3408
|
-
console.log("----tokenService2----", tokenService2);
|
|
3409
|
-
console.log("----tokenService2----", JSON.stringify(tokenService2));
|
|
3410
3407
|
try {
|
|
3411
|
-
|
|
3408
|
+
console.log("----dbUser----", dbUser);
|
|
3409
|
+
console.log("----dbUser----", JSON.stringify(dbUser));
|
|
3410
|
+
const jwtToken2 = strapi.plugins["users-permissions"].services.jwt.issue({
|
|
3411
|
+
id: dbUser.id
|
|
3412
|
+
});
|
|
3412
3413
|
console.log("----jwtToken2----", jwtToken2);
|
|
3414
|
+
console.log("----jwtToken2----", JSON.stringify(jwtToken2));
|
|
3413
3415
|
} catch (e2) {
|
|
3414
3416
|
console.log("----jwtToken2----, e", JSON.stringify(e2));
|
|
3415
3417
|
}
|
|
3416
|
-
try {
|
|
3417
|
-
const jwtToken3 = await tokenService2.createToken(dbUser);
|
|
3418
|
-
console.log("----jwtToken3----", jwtToken3);
|
|
3419
|
-
} catch (e2) {
|
|
3420
|
-
console.log("----jwtToken3----, e", JSON.stringify(e2));
|
|
3421
|
-
}
|
|
3422
3418
|
return ctx.send({ accessToken: jwtToken, refreshToken: tokenResponse.data.refresh_token });
|
|
3423
3419
|
} catch (e2) {
|
|
3424
3420
|
console.error(e2.message);
|
package/package.json
CHANGED