@fonderie/auth 7.3.5 → 7.4.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.d.cts CHANGED
@@ -2,8 +2,8 @@ export { IMfaChallenge, ISession, IUser } from './types.cjs';
2
2
  import { IFonderieModule, IReadinessProblem, IFonderieApp } from '@fonderie/core';
3
3
  import { IStoreAdapter } from '@fonderie/store';
4
4
  import { EventBus } from '@fonderie/events';
5
- import { I as IAuthConfig } from './session-Dc5-JNoW.cjs';
6
- export { A as AUTH_CONFIG_KEYS, a as AuthLimitedRoute, b as AuthMessageKey, c as IAuthRateLimitConfig, d as IAuthRuntimeConfig, e as IAuthSecrets, f as IDataExportContributor, M as MESSAGE_KEYS, g as buildAuthAccountLimiter, h as buildAuthIpLimiter, w as withSession } from './session-Dc5-JNoW.cjs';
5
+ import { I as IAuthConfig } from './session-CvNqy0Kd.cjs';
6
+ export { A as AUTH_CONFIG_KEYS, a as AuthLimitedRoute, b as AuthMessageKey, c as IAuthRateLimitConfig, d as IAuthRuntimeConfig, e as IAuthSecrets, f as IDataExportContributor, M as MESSAGE_KEYS, g as buildAuthAccountLimiter, h as buildAuthIpLimiter, w as withSession } from './session-CvNqy0Kd.cjs';
7
7
  export { IUserDTO, toUserDTO } from './dtos/user.cjs';
8
8
  export { requireAuth, validate } from '@fonderie/core/middlewares';
9
9
  import { z } from 'zod';
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export { IMfaChallenge, ISession, IUser } from './types.js';
2
2
  import { IFonderieModule, IReadinessProblem, IFonderieApp } from '@fonderie/core';
3
3
  import { IStoreAdapter } from '@fonderie/store';
4
4
  import { EventBus } from '@fonderie/events';
5
- import { I as IAuthConfig } from './session-Dc5-JNoW.js';
6
- export { A as AUTH_CONFIG_KEYS, a as AuthLimitedRoute, b as AuthMessageKey, c as IAuthRateLimitConfig, d as IAuthRuntimeConfig, e as IAuthSecrets, f as IDataExportContributor, M as MESSAGE_KEYS, g as buildAuthAccountLimiter, h as buildAuthIpLimiter, w as withSession } from './session-Dc5-JNoW.js';
5
+ import { I as IAuthConfig } from './session-CvNqy0Kd.js';
6
+ export { A as AUTH_CONFIG_KEYS, a as AuthLimitedRoute, b as AuthMessageKey, c as IAuthRateLimitConfig, d as IAuthRuntimeConfig, e as IAuthSecrets, f as IDataExportContributor, M as MESSAGE_KEYS, g as buildAuthAccountLimiter, h as buildAuthIpLimiter, w as withSession } from './session-CvNqy0Kd.js';
7
7
  export { IUserDTO, toUserDTO } from './dtos/user.js';
8
8
  export { requireAuth, validate } from '@fonderie/core/middlewares';
9
9
  import { z } from 'zod';
package/dist/index.js CHANGED
@@ -44,6 +44,7 @@ var init_password = __esm({
44
44
  });
45
45
 
46
46
  // src/routes.ts
47
+ import { setApiResponse as setApiResponse6, HTTP as HTTP6 } from "@fonderie/core";
47
48
  import { requireAuth, requireAnyAuth, requireVerified } from "@fonderie/core/middlewares";
48
49
 
49
50
  // src/middlewares/require-email-login.ts
@@ -2711,6 +2712,27 @@ function buildAuthRoutes(store, config, bus) {
2711
2712
  return [o.method ?? method, o.path ?? path, ...handlers];
2712
2713
  };
2713
2714
  const routes = [
2715
+ // Which sign-in methods this deployment can actually honour (Public).
2716
+ //
2717
+ // A frontend has to decide which buttons to draw, and the only honest
2718
+ // source is the side holding the credentials. The alternative — a
2719
+ // build-time flag in the app — stores the same fact twice and lets the
2720
+ // two disagree; the symptom is a user clicking a provider the server
2721
+ // cannot complete and landing on the provider's error page, which the
2722
+ // app cannot explain.
2723
+ //
2724
+ // Public and unauthenticated on purpose: the login screen needs it
2725
+ // before anyone has signed in. It discloses nothing a visitor could not
2726
+ // learn by looking at the buttons, and deliberately nothing else — no
2727
+ // client ids, no redirect URIs, no module inventory.
2728
+ R(
2729
+ "providers",
2730
+ "GET",
2731
+ "/auth/providers",
2732
+ async () => setApiResponse6(HTTP6.OK, "AUTH_PROVIDERS", "Sign-in methods available here", {
2733
+ providers: [...config.providers]
2734
+ })
2735
+ ),
2714
2736
  // Registration & Login (Public)
2715
2737
  R("register", "POST", "/auth/register", ipLimit("register"), validate(registerSchema), auth.register),
2716
2738
  R("login", "POST", "/auth/login", ipLimit("login"), validate(loginSchema), acctLimit("login"), auth.login),