-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding mfa verifying as a data route in data api
- Loading branch information
1 parent
a4b18e2
commit e61c174
Showing
7 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ | |
buildInputs = [ | ||
bacon | ||
cargo-nextest | ||
cargo-shuttle | ||
# cargo-shuttle | ||
jq | ||
nixpkgs-fmt | ||
openssl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pub mod router; | ||
mod service; | ||
pub mod service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::sync::Arc; | ||
|
||
use askama_axum::IntoResponse; | ||
use axum::{extract::State, routing::post, Json, Router}; | ||
|
||
use crate::{auth::AuthSession, hypermedia::schema::auth::MfaTokenForm, AppState}; | ||
|
||
pub fn private_router() -> Router<Arc<AppState>> { | ||
Router::new().route("/api/auth/mfa", post(mfa_verify)) | ||
} | ||
|
||
async fn mfa_verify( | ||
auth_session: AuthSession, | ||
State(shared_state): State<Arc<AppState>>, | ||
Json(mfa_token): Json<MfaTokenForm>, | ||
) -> impl IntoResponse { | ||
crate::hypermedia::service::auth::mfa_verify(auth_session, &shared_state.pool, mfa_token.token) | ||
.await | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod auth; | ||
pub mod expenses; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pub mod router; | ||
mod schema; | ||
mod service; | ||
pub mod schema; | ||
pub mod service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters