Fix authentication validation to properly reject invalid CalDAV servers
All checks were successful
Build and Push Docker Image / docker (push) Successful in 1m9s
All checks were successful
Build and Push Docker Image / docker (push) Successful in 1m9s
- Backend: Enhance CalDAV discovery to require at least one valid 207 response - Backend: Fail authentication if no valid CalDAV endpoints are found - Frontend: Add token verification on app startup to validate stored tokens - Frontend: Clear invalid tokens when login fails or token verification fails - Frontend: Prevent users with invalid tokens from accessing calendar page This resolves the issue where invalid servers (like google.com) were incorrectly accepted as valid CalDAV servers, and ensures proper authentication flow. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -145,6 +145,10 @@ pub fn Login(props: &LoginProps) -> Html {
|
||||
}
|
||||
Err(err) => {
|
||||
web_sys::console::log_1(&format!("❌ Login failed: {}", err).into());
|
||||
// Clear any existing invalid tokens
|
||||
let _ = LocalStorage::delete("auth_token");
|
||||
let _ = LocalStorage::delete("session_token");
|
||||
let _ = LocalStorage::delete("caldav_credentials");
|
||||
error_message.set(Some(err));
|
||||
is_loading.set(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user