use latest version

This commit is contained in:
maix0 2025-01-15 23:51:25 +01:00
parent 5bd61986f9
commit 26a9ab37ba
3 changed files with 485 additions and 255 deletions

714
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -4,17 +4,18 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
axum = { version = "0.7.5", features = ["multipart", "macros"] } axum = { version = "0.8.1", features = ["multipart", "macros"] }
axum-extra = { version = "0.9.3", features = ["cookie-private"] } axum-extra = { version = "0.10.0", features = ["cookie-private"] }
base64 = "0.22.1" base64 = "0.22.1"
color-eyre = "0.6.3" color-eyre = "0.6.3"
http = "1.1.0" http = "1.2.0"
pct-str = "2.0.0" pct-str = "2.0.0"
rand = "0.8.5" rand = "0.8.5"
reqwest = { version = "0.12.5", features = ["json", "default-tls"] } reqwest = { version = "0.12.12", features = ["json", "default-tls"] }
serde = { version = "1.0.203", features = ["derive"] } serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.118" serde_json = "1.0.135"
time = "0.3.36" time = "0.3.37"
tokio = { version = "1.38.0", features = ["full"] } tokio = { version = "1.43.0", features = ["full"] }
tracing = "0.1.40" tower-http = { version = "0.6.2", features = ["trace"] }
tracing-subscriber = "0.3.18" tracing = "0.1.41"
tracing-subscriber = "0.3.19"

View file

@ -10,7 +10,6 @@ use std::{
}; };
use axum::{ use axum::{
async_trait,
extract::{FromRef, FromRequestParts, Query, State}, extract::{FromRef, FromRequestParts, Query, State},
http::{request::Parts, StatusCode}, http::{request::Parts, StatusCode},
response::{Html, IntoResponse, Redirect}, response::{Html, IntoResponse, Redirect},
@ -113,7 +112,8 @@ async fn main() {
.route("/auth/callback", get(oauth2_callback)) .route("/auth/callback", get(oauth2_callback))
.route("/auth/login", get(oauth2_login)) .route("/auth/login", get(oauth2_login))
.route("/auth/error", get(auth_error)) .route("/auth/error", get(auth_error))
.with_state(state); .with_state(state)
.layer(tower_http::trace::TraceLayer::new_for_http());
// run our app with hyper // run our app with hyper
let listener = tokio::net::TcpListener::bind(format!( let listener = tokio::net::TcpListener::bind(format!(
@ -195,7 +195,6 @@ async fn oauth2_callback(
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
struct UserLoggedIn; struct UserLoggedIn;
#[async_trait]
impl FromRequestParts<AppState> for UserLoggedIn { impl FromRequestParts<AppState> for UserLoggedIn {
type Rejection = (StatusCode, PrivateCookieJar, Redirect); type Rejection = (StatusCode, PrivateCookieJar, Redirect);