mancala/apps/frontend/src/const/config.ts
Halit Aksoy f5dcf930fa feat(frontend): log in with Keycloak, as a guest or with an account
- First visit logs in as a new guest through Keycloak without a form;
  the session, including an offline refresh token, is kept in local storage
- Account menu on the home page: guests can log in or sign up, users can
  log out (which starts a new guest session)
- The WebSocket client in core authenticates with the access token after
  connecting, reports "connected" once the server accepts it, and re-sends
  renewed tokens on the open connection
- Game page shows player names; guests appear as "Guest 4F2A"
- Auth channels, AuthUser and player names in UserConnectionInfo move to
  core and the backend uses them from there
- Mobile keeps using userKey login for now
2026-10-14 02:22:13 +03:00

27 lines
847 B
TypeScript

export const isAlpha = true;
export type Server = {
serverAdress: string;
wsServerAdress: string;
};
export const LOCAL_SERVER_ADDRESS='http://localhost:5005';
export const LOCAL_WS_SERVER_ADDRESS='ws://localhost:5005';
export const server: Server = {
//@ts-ignore
serverAdress: process.env.SERVER_ADDRESS ? `${process.env.SERVER_ADDRESS}` : LOCAL_SERVER_ADDRESS,
//@ts-ignore
wsServerAdress: process.env.WS_SERVER_ADDRESS ? `${process.env.WS_SERVER_ADDRESS}` : LOCAL_WS_SERVER_ADDRESS,
}
export const LOCAL_KEYCLOAK_URL = 'http://localhost:8080';
export const keycloak = {
//@ts-ignore
url: process.env.KEYCLOAK_URL ? `${process.env.KEYCLOAK_URL}` : LOCAL_KEYCLOAK_URL,
realm: "mancala",
clientId: "mancala-web",
};
export const RTMT_WS_PING_INTERVAL = 1000, RTMT_WS_PING_INTERVAL_BUFFER_TIME = 2000;