Add /openid/token
route
This commit is contained in:
@ -13,7 +13,7 @@ use actix_web::body::EitherBody;
|
||||
use actix_web::http::{header, Method};
|
||||
use askama::Template;
|
||||
|
||||
use crate::constants::{ADMIN_ROUTES, AUTHENTICATED_ROUTES, AUTHORIZE_URI};
|
||||
use crate::constants::{ADMIN_ROUTES, AUTHENTICATED_ROUTES, AUTHORIZE_URI, TOKEN_URI};
|
||||
use crate::controllers::base_controller::{FatalErrorPage, redirect_user_for_login};
|
||||
use crate::data::app_config::AppConfig;
|
||||
use crate::data::session_identity::{SessionIdentity, SessionIdentityData, SessionStatus};
|
||||
@ -91,7 +91,7 @@ impl<S, B> Service<ServiceRequest> for AuthInnerMiddleware<S>
|
||||
|
||||
// Check if POST request comes from another website (block invalid origins)
|
||||
let origin = req.headers().get(header::ORIGIN);
|
||||
if req.method() == Method::POST {
|
||||
if req.method() == Method::POST && req.path() != TOKEN_URI {
|
||||
if let Some(o) = origin {
|
||||
if !o.to_str().unwrap_or("bad").eq(&config.website_origin) {
|
||||
log::warn!(
|
||||
|
Reference in New Issue
Block a user