mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 07:51:02 +00:00
feat: dev and staging bypass
This commit is contained in:
13
apps/edr-freight-api/src/common/dev-bypass.util.ts
Normal file
13
apps/edr-freight-api/src/common/dev-bypass.util.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Dev/staging bypass gate for OTP, payment and Fayda verification.
|
||||
*
|
||||
* Gated purely on `ENV` (dev|staging) — never on NODE_ENV, so it can't be
|
||||
* mistaken for a prod-vs-non-prod switch. `ENV` is simply left unset in
|
||||
* production, so this is always false there.
|
||||
*/
|
||||
export function isBypassEnv(): boolean {
|
||||
return ["dev", "staging"].includes(process.env.ENV ?? "");
|
||||
}
|
||||
|
||||
/** Fixed code accepted in addition to the real one when isBypassEnv(). */
|
||||
export const DEV_BYPASS_OTP = "000000";
|
||||
Reference in New Issue
Block a user