Add IP location service
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -23,7 +23,7 @@ use crate::data::user::User;
|
||||
use crate::utils::string_utils::rand_str;
|
||||
use crate::utils::time::time;
|
||||
|
||||
pub async fn get_configuration(req: HttpRequest, app_conf: web::Data<AppConfig>) -> impl Responder {
|
||||
pub async fn get_configuration(req: HttpRequest) -> impl Responder {
|
||||
let is_secure_request = req
|
||||
.headers()
|
||||
.get("HTTP_X_FORWARDED_PROTO")
|
||||
@ -45,8 +45,8 @@ pub async fn get_configuration(req: HttpRequest, app_conf: web::Data<AppConfig>)
|
||||
);
|
||||
|
||||
HttpResponse::Ok().json(OpenIDConfig {
|
||||
issuer: app_conf.website_origin.clone(),
|
||||
authorization_endpoint: app_conf.full_url(AUTHORIZE_URI),
|
||||
issuer: AppConfig::get().website_origin.clone(),
|
||||
authorization_endpoint: AppConfig::get().full_url(AUTHORIZE_URI),
|
||||
token_endpoint: curr_origin.clone() + TOKEN_URI,
|
||||
userinfo_endpoint: curr_origin.clone() + USERINFO_URI,
|
||||
jwks_uri: curr_origin + CERT_URI,
|
||||
@ -263,7 +263,6 @@ pub async fn token(
|
||||
req: HttpRequest,
|
||||
query: web::Form<TokenQuery>,
|
||||
clients: web::Data<ClientManager>,
|
||||
app_config: web::Data<AppConfig>,
|
||||
sessions: web::Data<Addr<OpenIDSessionsActor>>,
|
||||
users: web::Data<Addr<UsersActor>>,
|
||||
jwt_signer: web::Data<JWTSigner>,
|
||||
@ -416,7 +415,7 @@ pub async fn token(
|
||||
));
|
||||
}
|
||||
|
||||
session.regenerate_access_and_refresh_tokens(&app_config, &jwt_signer)?;
|
||||
session.regenerate_access_and_refresh_tokens(AppConfig::get(), &jwt_signer)?;
|
||||
|
||||
sessions
|
||||
.send(openid_sessions_actor::UpdateSession(session.clone()))
|
||||
@ -435,7 +434,7 @@ pub async fn token(
|
||||
|
||||
// Generate id token
|
||||
let id_token = IdToken {
|
||||
issuer: app_config.website_origin.to_string(),
|
||||
issuer: AppConfig::get().website_origin.to_string(),
|
||||
subject_identifier: session.user.0,
|
||||
audience: session.client.0.to_string(),
|
||||
expiration_time: session.access_token_expire_at,
|
||||
@ -488,7 +487,7 @@ pub async fn token(
|
||||
));
|
||||
}
|
||||
|
||||
session.regenerate_access_and_refresh_tokens(&app_config, &jwt_signer)?;
|
||||
session.regenerate_access_and_refresh_tokens(AppConfig::get(), &jwt_signer)?;
|
||||
|
||||
sessions
|
||||
.send(openid_sessions_actor::UpdateSession(session.clone()))
|
||||
|
Reference in New Issue
Block a user