better-auth 1.2.4-beta.10 → 1.2.4-beta.12

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const admin = require('../../shared/better-auth.BB4ttfim.cjs');
3
+ const admin = require('../../shared/better-auth.CR_ASYNx.cjs');
4
4
  require('zod');
5
5
  require('better-call');
6
6
  require('../../shared/better-auth.GVCiTzec.cjs');
@@ -1,4 +1,4 @@
1
- export { a as admin } from '../../shared/better-auth.CKKeYM2g.mjs';
1
+ export { a as admin } from '../../shared/better-auth.BH6IWaNB.mjs';
2
2
  import 'zod';
3
3
  import 'better-call';
4
4
  import '../../shared/better-auth.CFZLHBFT.mjs';
@@ -8,7 +8,7 @@ const account = require('../shared/better-auth.GVCiTzec.cjs');
8
8
  const plugins_magicLink_index = require('./magic-link/index.cjs');
9
9
  const plugins_phoneNumber_index = require('./phone-number/index.cjs');
10
10
  const plugins_anonymous_index = require('./anonymous/index.cjs');
11
- const admin = require('../shared/better-auth.BB4ttfim.cjs');
11
+ const admin = require('../shared/better-auth.CR_ASYNx.cjs');
12
12
  const plugins_genericOauth_index = require('./generic-oauth/index.cjs');
13
13
  const plugins_jwt_index = require('./jwt/index.cjs');
14
14
  const plugins_multiSession_index = require('./multi-session/index.cjs');
@@ -7,7 +7,7 @@ export { H as HIDE_METADATA, N as optionsMiddleware } from '../shared/better-aut
7
7
  export { magicLink } from './magic-link/index.mjs';
8
8
  export { phoneNumber } from './phone-number/index.mjs';
9
9
  export { anonymous } from './anonymous/index.mjs';
10
- export { a as admin } from '../shared/better-auth.CKKeYM2g.mjs';
10
+ export { a as admin } from '../shared/better-auth.BH6IWaNB.mjs';
11
11
  export { genericOAuth } from './generic-oauth/index.mjs';
12
12
  export { getJwtToken, jwt } from './jwt/index.mjs';
13
13
  export { multiSession } from './multi-session/index.mjs';
@@ -49,7 +49,7 @@ const admin = (options) => {
49
49
  };
50
50
  const adminMiddleware = createAuthMiddleware(async (ctx) => {
51
51
  const session = await getSessionFromCtx(ctx);
52
- if ((!session?.session || !opts.adminRoles.includes(session.user.role)) && !opts.adminUserIds?.includes(session?.user.id || "")) {
52
+ if (!session) {
53
53
  throw new APIError("UNAUTHORIZED");
54
54
  }
55
55
  return {
@@ -51,7 +51,7 @@ const admin = (options) => {
51
51
  };
52
52
  const adminMiddleware = account.createAuthMiddleware(async (ctx) => {
53
53
  const session = await account.getSessionFromCtx(ctx);
54
- if ((!session?.session || !opts.adminRoles.includes(session.user.role)) && !opts.adminUserIds?.includes(session?.user.id || "")) {
54
+ if (!session) {
55
55
  throw new betterCall.APIError("UNAUTHORIZED");
56
56
  }
57
57
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth",
3
- "version": "1.2.4-beta.10",
3
+ "version": "1.2.4-beta.12",
4
4
  "description": "The most comprehensive authentication library for TypeScript.",
5
5
  "type": "module",
6
6
  "repository": {