import type { User, UserAuth } from "@customer-portal/domain/customer";
import type { Request } from "express";
import type { AuthTokens } from "@customer-portal/domain/auth";

export type RequestWithUser = Request & { user: User };

/**
 * Request with optional user - used for @OptionalAuth() endpoints
 * where no token = user is undefined, valid token = user is attached
 */
export type RequestWithOptionalUser = Request & { user?: User };

/**
 * Internal auth result used inside the BFF to set cookies.
 * Token strings must not be returned to the browser.
 */
export type AuthResultInternal = {
  user: UserAuth;
  tokens: AuthTokens;
};
