auth-config.ts 880 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Briven Auth readiness for the portal.
  3. * Real sign-in needs project id + browser public key (pk_briven_auth_…).
  4. */
  5. export function getBrivenProjectId(): string | undefined {
  6. const id = process.env.NEXT_PUBLIC_BRIVEN_PROJECT_ID?.trim();
  7. return id || undefined;
  8. }
  9. export function getBrivenAuthPublicKey(): string | undefined {
  10. const key =
  11. process.env.NEXT_PUBLIC_BRIVEN_AUTH_KEY?.trim() ||
  12. process.env.BRIVEN_AUTH_PUBLIC_KEY?.trim();
  13. return key || undefined;
  14. }
  15. export function isBrivenAuthConfigured(): boolean {
  16. const id = getBrivenProjectId();
  17. const key = getBrivenAuthPublicKey();
  18. return Boolean(id && key && key.startsWith("pk_briven_auth_"));
  19. }
  20. export const DEMO_SESSION_KEY = "krypco_demo_session";
  21. export type DemoSession = {
  22. kind: "demo" | "wallet";
  23. userId: string;
  24. label: string;
  25. walletAddress?: string;
  26. createdAt: string;
  27. };