Login screen and api endpoint reorganization
This commit is contained in:
@@ -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")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user