lighty_event/module/
auth.rs

1// Copyright (c) 2025 Hamadi
2// Licensed under the MIT License
3
4//! Authentication events
5
6use serde::{Deserialize, Serialize};
7
8/// Authentication events
9#[derive(Debug, Clone, Serialize, Deserialize)]
10#[serde(tag = "event")]
11pub enum AuthEvent {
12    /// Authentication process begins
13    AuthenticationStarted {
14        provider: String,
15    },
16    /// Authentication is ongoing (generic progress)
17    AuthenticationInProgress {
18        provider: String,
19        step: String,
20    },
21    /// Authentication succeeded
22    AuthenticationSuccess {
23        provider: String,
24        username: String,
25        uuid: String,
26    },
27    /// Authentication failed
28    AuthenticationFailed {
29        provider: String,
30        error: String,
31    },
32    /// Valid session already exists (skip auth)
33    AlreadyAuthenticated {
34        provider: String,
35        username: String,
36    },
37}