Skip to content

Commit 4253d00

Browse files
LawnGnomeTurbo87
authored andcommitted
auth: Extract AuthCheck::check_authentication() fn
This will make it easier to test the logic in the future.
1 parent aa42f79 commit 4253d00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/auth.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ impl AuthCheck {
6262
conn: &mut PgConnection,
6363
) -> AppResult<Authentication> {
6464
let auth = authenticate(request, conn)?;
65+
self.check_authentication(auth)
66+
}
6567

68+
pub fn check_authentication(&self, auth: Authentication) -> AppResult<Authentication> {
6669
if let Some(token) = auth.api_token() {
6770
if !self.allow_token {
6871
let error_message =

0 commit comments

Comments
 (0)