only set path to relative
parent
17ec2185d0
commit
9a832a5aac
|
@ -9,7 +9,7 @@ use axum::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use axum_extra::extract::{cookie::Cookie, CookieJar};
|
use axum_extra::extract::{cookie::Cookie, CookieJar};
|
||||||
use reqwest::{Proxy, StatusCode};
|
use reqwest::{Proxy, StatusCode, Url};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
use tracing::{error, info};
|
use tracing::{error, info};
|
||||||
|
@ -221,8 +221,10 @@ pub(crate) async fn v2_auth(
|
||||||
);
|
);
|
||||||
// TODO: add permissions based on roles
|
// TODO: add permissions based on roles
|
||||||
|
|
||||||
|
let uri = Url::parse(&state.origin).expect("should be a valid url");
|
||||||
|
|
||||||
let mut cookie = Cookie::new("access_token", token.clone());
|
let mut cookie = Cookie::new("access_token", token.clone());
|
||||||
cookie.set_path(format!("{}/", state.origin));
|
cookie.set_path(uri.path().to_string());
|
||||||
cookie.set_secure(true);
|
cookie.set_secure(true);
|
||||||
|
|
||||||
Ok((jar.add(cookie), Redirect::to(&format!("{}/", state.origin))))
|
Ok((jar.add(cookie), Redirect::to(&format!("{}/", state.origin))))
|
||||||
|
|
Loading…
Reference in New Issue