Add external calendars feature: display read-only ICS calendars alongside CalDAV calendars
- Database: Add external_calendars table with user relationships and CRUD operations - Backend: Implement REST API endpoints for external calendar management and ICS fetching - Frontend: Add external calendar modal, sidebar section with visibility toggles - Calendar integration: Merge external events with regular events in unified view - ICS parsing: Support multiple datetime formats, recurring events, and timezone handling - Authentication: Integrate with existing JWT token system for user-specific calendars - UI: Visual distinction with 📅 indicator and separate management section 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -112,6 +112,17 @@ impl AuthService {
|
||||
self.decode_token(token)
|
||||
}
|
||||
|
||||
/// Get user from token
|
||||
pub async fn get_user_from_token(&self, token: &str) -> Result<crate::db::User, ApiError> {
|
||||
let claims = self.verify_token(token)?;
|
||||
|
||||
let user_repo = UserRepository::new(&self.db);
|
||||
user_repo
|
||||
.find_or_create(&claims.username, &claims.server_url)
|
||||
.await
|
||||
.map_err(|e| ApiError::Database(format!("Failed to get user: {}", e)))
|
||||
}
|
||||
|
||||
/// Create CalDAV config from token
|
||||
pub fn caldav_config_from_token(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user