use actix_web::{get, web};
use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub enum ResponseType {
Token,
Code
}
#[derive(Debug, Deserialize)]
pub struct AuthRequest {
id: u64,
response_type: ResponseType,
}
#[get("/")]
async fn index(info: web::Query<AuthRequest>) -> String {
format!("Authorization request for id={} and type={:?}!", info.id, info.response_type)
}
#[get("/debug1")]
async fn debug1(info: web::Query<AuthRequest>) -> String {
dbg!("Authorization object = {:?}", info.into_inner());
"OK".to_string()
}
#[get("/debug2")]
async fn debug2(web::Query(info): web::Query<AuthRequest>) -> String {
dbg!("Authorization object = {:?}", info);
"OK".to_string()
}