@sentry/junior-dashboard 0.104.1 → 0.104.2

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": "@sentry/junior-dashboard",
3
- "version": "0.104.1",
3
+ "version": "0.104.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -33,8 +33,8 @@
33
33
  "react-router": "^7.16.0",
34
34
  "shiki": "4.1.0",
35
35
  "zod": "^4.4.3",
36
- "@sentry/junior": "0.104.1",
37
- "@sentry/junior-plugin-api": "0.104.1"
36
+ "@sentry/junior": "0.104.2",
37
+ "@sentry/junior-plugin-api": "0.104.2"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@tailwindcss/cli": "^4.3.0",
package/src/api/schema.ts CHANGED
@@ -6,7 +6,6 @@ export const dashboardIdentitySchema = z
6
6
  .object({
7
7
  email: z.string().trim().email(),
8
8
  emailVerified: z.boolean().optional(),
9
- hostedDomain: z.string().nullable().optional(),
10
9
  name: z.string().nullable().optional(),
11
10
  })
12
11
  .strict(),
package/src/app.ts CHANGED
@@ -272,14 +272,18 @@ function isAuthorized(
272
272
  allowedEmails: string[],
273
273
  ): boolean {
274
274
  const email = session.user.email.toLowerCase();
275
- const domain = session.user.hostedDomain?.toLowerCase();
275
+ const emailSeparator = email.lastIndexOf("@");
276
+ const emailDomain =
277
+ emailSeparator > 0 ? email.slice(emailSeparator + 1) : undefined;
276
278
 
277
279
  if (session.user.emailVerified && email && allowedEmails.includes(email)) {
278
280
  return true;
279
281
  }
280
282
 
281
283
  return Boolean(
282
- session.user.emailVerified && domain && allowedDomains.includes(domain),
284
+ session.user.emailVerified &&
285
+ emailDomain &&
286
+ allowedDomains.includes(emailDomain),
283
287
  );
284
288
  }
285
289
 
@@ -338,9 +342,6 @@ function localAuthBypassSession(
338
342
  user: {
339
343
  email,
340
344
  emailVerified: true,
341
- hostedDomain: email.endsWith("@sentry.io")
342
- ? "sentry.io"
343
- : "localhost.test",
344
345
  },
345
346
  };
346
347
  }
@@ -531,13 +532,12 @@ function pluginRouteContext(
531
532
  pluginName: string,
532
533
  session: DashboardSession,
533
534
  ): PluginApiRouteRequestContext {
534
- const { email, emailVerified, hostedDomain, name } = session.user;
535
+ const { email, emailVerified, name } = session.user;
535
536
  return {
536
537
  auth: {
537
538
  user: {
538
539
  email,
539
540
  emailVerified,
540
- hostedDomain,
541
541
  name,
542
542
  },
543
543
  },
package/src/auth.ts CHANGED
@@ -29,12 +29,11 @@ export interface DashboardAuth {
29
29
  export function sanitizeDashboardSession(
30
30
  session: DashboardSession,
31
31
  ): DashboardSession {
32
- const { email, emailVerified, hostedDomain, name } = session.user;
32
+ const { email, emailVerified, name } = session.user;
33
33
  return dashboardIdentitySchema.parse({
34
34
  user: {
35
35
  email,
36
36
  emailVerified,
37
- hostedDomain,
38
37
  name,
39
38
  },
40
39
  });
@@ -87,23 +86,12 @@ export function createDashboardAuth(
87
86
  return {
88
87
  email: profile.email,
89
88
  emailVerified: profile.email_verified,
90
- hostedDomain: profile.hd,
91
89
  image: profile.picture,
92
90
  name: profile.name,
93
91
  };
94
92
  },
95
93
  },
96
94
  },
97
- user: {
98
- additionalFields: {
99
- hostedDomain: {
100
- type: "string",
101
- required: false,
102
- input: false,
103
- returned: true,
104
- },
105
- },
106
- },
107
95
  account: {
108
96
  storeStateStrategy: "cookie",
109
97
  storeAccountCookie: false,