mirror of
https://github.com/bitwarden/browser
synced 2026-02-02 09:43:29 +00:00
feat(redirect): [PM-26578] Https Redirection for Cloud Users - Rolled back webpack changes
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
declare const __PM_6962_NATIVE_MOBILE_APPS_CLIENT_UPDATES__: boolean;
|
||||
const SELF_HOSTED = (process.env.SELF_HOSTED || "false").toLowerCase() === "true";
|
||||
|
||||
function appLinkHost(): string {
|
||||
const h = window.location.hostname || "";
|
||||
if (h.endsWith("bitwarden.eu")) {
|
||||
return "bitwarden.eu";
|
||||
}
|
||||
if (h.endsWith("bitwarden.pw")) {
|
||||
return "bitwarden.pw";
|
||||
}
|
||||
return "bitwarden.com";
|
||||
}
|
||||
|
||||
export function buildMobileCallbackUri(kind: "sso" | "duo" | "webauthn"): string {
|
||||
const path = `${kind}-callback`;
|
||||
if (!SELF_HOSTED && __PM_6962_NATIVE_MOBILE_APPS_CLIENT_UPDATES__) {
|
||||
return `https://${appLinkHost()}/${path}`;
|
||||
}
|
||||
return `bitwarden://${path}`;
|
||||
}
|
||||
@@ -215,7 +215,6 @@ module.exports.buildConfig = function buildConfig(params) {
|
||||
NODE_ENV: NODE_ENV === "production" ? "production" : "development",
|
||||
APPLICATION_VERSION: pjson.version,
|
||||
CACHE_TAG: Math.random().toString(36).substring(7),
|
||||
SELF_HOSTED: process.env.SELF_HOSTED ?? (ENV === "selfhosted" ? "true" : "false"),
|
||||
URLS: envConfig["urls"] ?? {},
|
||||
STRIPE_KEY: envConfig["stripeKey"] ?? "",
|
||||
BRAINTREE_KEY: envConfig["braintreeKey"] ?? "",
|
||||
@@ -224,15 +223,6 @@ module.exports.buildConfig = function buildConfig(params) {
|
||||
DEV_FLAGS: NODE_ENV === "development" ? envConfig["devFlags"] : {},
|
||||
ADDITIONAL_REGIONS: envConfig["additionalRegions"] ?? [],
|
||||
}),
|
||||
// compile‑time constant for so that at compile time logic branches can be pruned that aren't
|
||||
// possible.
|
||||
new webpack.DefinePlugin({
|
||||
__PM_6962_NATIVE_MOBILE_APPS_CLIENT_UPDATES__: JSON.stringify(
|
||||
(process.env.PM_6962_NATIVE_MOBILE_APPS_CLIENT_UPDATES
|
||||
? process.env.PM_6962_NATIVE_MOBILE_APPS_CLIENT_UPDATES.toLowerCase() === "true"
|
||||
: ENV !== "selfhosted") === true,
|
||||
),
|
||||
}),
|
||||
new AngularWebpackPlugin({
|
||||
tsconfig: params.tsConfig,
|
||||
entryModule: params.app.entryModule,
|
||||
|
||||
Reference in New Issue
Block a user