summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-06-09 14:55:03 -0600
committermo khan <mo@mokhan.ca>2025-06-09 14:55:03 -0600
commitc3527d0ecea1dbc005f11d1912b0451b2660c889 (patch)
tree4929769d3c6201dc37868ef990218d36671eefc5 /src/main.rs
parentf22f53a71ef972684b7d8f9a18ee871467beed7d (diff)
refactor: remove non-essential metadata
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 64f8fa3..47bd1ff 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -28,13 +28,16 @@ mod tests {
let oauth_server = sts::OAuthServer::new(&config);
let mut params = HashMap::new();
params.insert("client_id".to_string(), "test_client".to_string());
- params.insert("redirect_uri".to_string(), "http://localhost:3000/callback".to_string());
+ params.insert(
+ "redirect_uri".to_string(),
+ "http://localhost:3000/callback".to_string(),
+ );
params.insert("response_type".to_string(), "code".to_string());
params.insert("state".to_string(), "test_state".to_string());
let result = oauth_server.handle_authorize(&params);
assert!(result.is_ok());
-
+
let redirect_url = result.unwrap();
assert!(redirect_url.contains("code="));
assert!(redirect_url.contains("state=test_state"));
@@ -45,7 +48,10 @@ mod tests {
let config = sts::Config::from_env();
let oauth_server = sts::OAuthServer::new(&config);
let mut params = HashMap::new();
- params.insert("redirect_uri".to_string(), "http://localhost:3000/callback".to_string());
+ params.insert(
+ "redirect_uri".to_string(),
+ "http://localhost:3000/callback".to_string(),
+ );
params.insert("response_type".to_string(), "code".to_string());
let result = oauth_server.handle_authorize(&params);
@@ -59,7 +65,10 @@ mod tests {
let oauth_server = sts::OAuthServer::new(&config);
let mut params = HashMap::new();
params.insert("client_id".to_string(), "test_client".to_string());
- params.insert("redirect_uri".to_string(), "http://localhost:3000/callback".to_string());
+ params.insert(
+ "redirect_uri".to_string(),
+ "http://localhost:3000/callback".to_string(),
+ );
params.insert("response_type".to_string(), "token".to_string());
let result = oauth_server.handle_authorize(&params);