Login screen and api endpoint reorganization

This commit is contained in:
Maurus Decimus
2026-04-05 19:57:23 +02:00
parent eecec0aa31
commit fde37b670f
29 changed files with 1005 additions and 1606 deletions

View File

@@ -105,8 +105,10 @@ pub async fn test() {
// Test authorization endpoint retrieval
assert_eq!(
oidc.oidc_authorization_endpoint(),
Some("http://localhost:9080/realms/stalwart/protocol/openid-connect/auth".to_string())
oidc.oidc_discovery_document()
.as_ref()
.map(|oidc| oidc.authorization_endpoint.as_str()),
Some("http://localhost:9080/realms/stalwart/protocol/openid-connect/auth")
);
}

View File

@@ -123,7 +123,7 @@ pub async fn test(test: &mut TestServer) {
// Authenticate with the correct password
let response = http
.post::<LoginResponse>(
"/auth/login",
"/api/auth",
&LoginRequest::AuthCode {
account_name: "user@example.org".to_string(),
account_secret: "this is a very strong password".to_string(),
@@ -131,6 +131,10 @@ pub async fn test(test: &mut TestServer) {
client_id: client_id.to_string(),
redirect_uri: "https://localhost".to_string().into(),
nonce: "abc1234".to_string().into(),
scope: None,
code_challenge: None,
code_challenge_method: None,
state: None,
},
)
.await
@@ -296,7 +300,7 @@ pub async fn test(test: &mut TestServer) {
tokio::time::sleep(Duration::from_secs(1)).await;
assert_eq!(
http.post::<LoginResponse>(
"/auth/login",
"/api/auth",
&LoginRequest::AuthDevice {
account_name: "user@example.org".to_string(),
account_secret: "this is a very strong password".to_string(),
@@ -324,7 +328,7 @@ pub async fn test(test: &mut TestServer) {
);
assert_eq!(
http.post::<LoginResponse>(
"/auth/login",
"/api/auth",
&LoginRequest::AuthDevice {
account_name: "user@example.org".to_string(),
account_secret: "this is a very strong password".to_string(),