Fix typos
This commit is contained in:
parent
04011e4f1a
commit
18fbb7fa5f
@ -30,9 +30,7 @@ pub struct Authenticated {
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum LoginError {
|
pub enum LoginError {
|
||||||
InvalidData,
|
UserNotLoggedIn
|
||||||
UsernameDoesNotExist,
|
|
||||||
WrongPassword
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request guard which returns an Authenticated struct with is_authenticated=true
|
/// Request guard which returns an Authenticated struct with is_authenticated=true
|
||||||
@ -55,7 +53,7 @@ impl<'r> FromRequest<'r> for Authenticated {
|
|||||||
request::Outcome::Success(auth)
|
request::Outcome::Success(auth)
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
request::Outcome::Failure((Status::Forbidden, LoginError::UsernameDoesNotExist))
|
request::Outcome::Failure((Status::Forbidden, LoginError::UserNotLoggedIn))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ pub fn internal_error() -> Template {
|
|||||||
Template::render("internal_error", context)
|
Template::render("internal_error", context)
|
||||||
}
|
}
|
||||||
|
|
||||||
// HELPERS AND ROUNTES FOR 403 FORBIDDEN
|
// HELPERS AND ROUTES FOR 403 FORBIDDEN
|
||||||
|
|
||||||
#[catch(403)]
|
#[catch(403)]
|
||||||
pub fn forbidden() -> Redirect {
|
pub fn forbidden() -> Redirect {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user