Skip to content

Commit

Permalink
fix: Remove auto login (#89)
Browse files Browse the repository at this point in the history
* Remove auto login

* fix: cargo fmt
  • Loading branch information
9876691 authored Feb 7, 2023
1 parent 365963c commit dbf2525
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
9 changes: 1 addition & 8 deletions src/auth/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ struct InsertedSession {
id: i32,
}

pub async fn login(config: web::Data<config::Config>, session: Option<crate::Session>) -> Result<HttpResponse> {

// Do we already have a session? If so, redirect.
if let Some(_) = session {
return Ok(HttpResponse::SeeOther()
.append_header((http::header::LOCATION, config.redirect_url.clone()))
.finish());
}
pub async fn login(config: web::Data<config::Config>) -> Result<HttpResponse> {
let body = LoginPage {
form: &Login::default(),
hcaptcha_config: &config.hcaptcha_config,
Expand Down
10 changes: 1 addition & 9 deletions src/encrypted_auth/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@ struct LoginUser {
master_password_hash: String,
}

pub async fn login(config: web::Data<config::Config>, session: Option<crate::Session>) -> Result<HttpResponse> {

// Do we already have a session? If so, redirect.
if let Some(_) = session {
return Ok(HttpResponse::SeeOther()
.append_header((http::header::LOCATION, config.redirect_url.clone()))
.finish());
}

pub async fn login(config: web::Data<config::Config>) -> Result<HttpResponse> {
let body = LoginPage {
form: &Login::default(),
errors: None,
Expand Down

0 comments on commit dbf2525

Please sign in to comment.