better-auth-studio 1.0.79-beta.13 → 1.0.79-beta.15
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/cli.js +0 -0
- package/dist/core/handler.js +4 -7
- package/dist/core/handler.js.map +1 -1
- package/dist/public/assets/{main-_2wvl-u1.js → main-6qxNhi40.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +4 -3
- package/dist/routes.js.map +1 -1
- package/package.json +29 -30
- package/public/assets/{main-_2wvl-u1.js → main-6qxNhi40.js} +1 -1
- package/public/index.html +1 -1
package/dist/public/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/png" href="/logo.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Better Auth Studio</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-6qxNhi40.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/main-C0mBl_hH.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAeA,OAAO,EAA+B,MAAM,EAAE,MAAM,SAAS,CAAC;AAS9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AA2FnE,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAqLhG;AAeD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,E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C;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;CAChE,CAAC,CA+FD"}
|
package/dist/routes.js
CHANGED
|
@@ -525,11 +525,10 @@ export function createRoutes(authConfig, configPath, geoDbPath, preloadedAdapter
|
|
|
525
525
|
const userRole = users[0].role;
|
|
526
526
|
const user = { id: userId, email: users[0].email, name: users[0].name, role: userRole };
|
|
527
527
|
const allowedRoles = getAllowedRoles();
|
|
528
|
-
console.log({ user, allowedRoles, credentialAccount });
|
|
529
528
|
if (!allowedRoles.includes(user.role)) {
|
|
530
529
|
return res.status(403).json({
|
|
531
530
|
success: false,
|
|
532
|
-
message: `Access denied
|
|
531
|
+
message: `Access denied.`,
|
|
533
532
|
userRole: user.role || 'none',
|
|
534
533
|
});
|
|
535
534
|
}
|
|
@@ -569,16 +568,18 @@ export function createRoutes(authConfig, configPath, geoDbPath, preloadedAdapter
|
|
|
569
568
|
where: [{ field: 'id', value: userId }],
|
|
570
569
|
limit: 1,
|
|
571
570
|
});
|
|
571
|
+
console.log({ users });
|
|
572
572
|
if (users && users.length > 0) {
|
|
573
573
|
userRole = users[0].role;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
+
console.log({ adapter, signInResult, userRole });
|
|
576
577
|
const user = { ...signInResult.user, role: userRole };
|
|
577
578
|
const allowedRoles = getAllowedRoles();
|
|
578
579
|
if (!allowedRoles.includes(user.role)) {
|
|
579
580
|
return res.status(403).json({
|
|
580
581
|
success: false,
|
|
581
|
-
message: `Access denied
|
|
582
|
+
message: `Access denied.`,
|
|
582
583
|
userRole: user.role || 'none',
|
|
583
584
|
});
|
|
584
585
|
}
|