@objectstack/plugin-auth 7.1.0 → 7.2.0

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/index.js CHANGED
@@ -1092,18 +1092,22 @@ var AuthManager = class {
1092
1092
  plugins.push(jwt({ schema: buildJwtPluginSchema() }));
1093
1093
  const { oauthProvider } = await import("@better-auth/oauth-provider");
1094
1094
  const baseUrl = (this.config.baseUrl ?? "").replace(/\/$/, "");
1095
+ const uiBase = (this.config.uiBasePath ?? "/_console").replace(/\/$/, "");
1095
1096
  plugins.push(oauthProvider({
1096
- // Account SPA renders both pages see apps/account.
1097
- loginPage: `${baseUrl}/_account/login`,
1098
- consentPage: `${baseUrl}/_account/oauth/consent`,
1097
+ // Console SPA renders both pages (replaces the legacy Account SPA at
1098
+ // /_account). Override `uiBasePath` in AuthConfig if Console is
1099
+ // mounted elsewhere.
1100
+ loginPage: `${baseUrl}${uiBase}/login`,
1101
+ consentPage: `${baseUrl}${uiBase}/oauth/consent`,
1099
1102
  schema: buildOauthProviderPluginSchema()
1100
1103
  }));
1101
1104
  }
1102
1105
  if (enabled.deviceAuthorization) {
1103
1106
  const { deviceAuthorization } = await import("better-auth/plugins/device-authorization");
1104
1107
  const baseUrl = (this.config.baseUrl ?? "").replace(/\/$/, "");
1108
+ const uiBase = (this.config.uiBasePath ?? "/_console").replace(/\/$/, "");
1105
1109
  plugins.push(deviceAuthorization({
1106
- verificationUri: `${baseUrl}/_account/auth/device`,
1110
+ verificationUri: `${baseUrl}${uiBase}/auth/device`,
1107
1111
  schema: buildDeviceAuthorizationPluginSchema()
1108
1112
  }));
1109
1113
  }