feat #14740: release builds use the production backend

Release builds talk to https://backend.euvinopro.eu, debug builds keep
https://test.euvinopro.eu. A key bound to the test backend is discarded
in a release build (fresh login).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hauke
2026-11-09 10:51:09 +01:00
co-authored by Claude Opus 5.5
parent a0f89454f9
commit d0ece263a2
2 changed files with 55 additions and 7 deletions
+10 -5
View File
@@ -31,11 +31,13 @@ use crate::state::AppState;
// The backend this build talks to: the one place to change it. It is not a
// setting; a key created on one backend is never sent to another.
/// Release builds. Switch to "https://backend.euvinopro.eu" here, then
/// release, once that backend is live.
const RELEASE_BACKEND_URL: &str = "https://test.euvinopro.eu";
/// Debug builds (`cargo tauri dev`) always use the test backend.
const DEV_BACKEND_URL: &str = "https://test.euvinopro.eu";
/// Release builds: the production euvino admin backend.
pub(crate) const RELEASE_BACKEND_URL: &str = "https://backend.euvinopro.eu";
/// Debug builds (`cargo tauri dev`) always use the test backend, never the
/// production one. `pub(crate)`: `state.rs` tests the exact test-backend →
/// release-backend transition against this value (a key bound to one must
/// never work for the other).
pub(crate) const DEV_BACKEND_URL: &str = "https://test.euvinopro.eu";
/// The backend of this build (no trailing slash).
pub const BACKEND_URL: &str = if cfg!(debug_assertions) {
DEV_BACKEND_URL
@@ -461,6 +463,9 @@ mod tests {
assert!(!url.ends_with('/'), "{url}");
assert!(url.starts_with("https://"), "{url}");
}
// Release and dev talk to different backends: a key from one must
// never be usable on the other (see AppState::backend_key).
assert_ne!(RELEASE_BACKEND_URL, DEV_BACKEND_URL);
}
#[test]