From fd2d2672bbc0443a3fdf28f75177040b8f95d126 Mon Sep 17 00:00:00 2001 From: Philippe Loctaux
Date: Mon, 1 May 2023 12:00:11 +0200
Subject: [PATCH] oauth authorize: if use has totp enable, generate a code,
store in a cookie and redirect to totp verification page
---
crates/ezidam/src/routes/oauth/authorize.rs | 83 ++++++++++++++++-----
1 file changed, 63 insertions(+), 20 deletions(-)
diff --git a/crates/ezidam/src/routes/oauth/authorize.rs b/crates/ezidam/src/routes/oauth/authorize.rs
index 0430d84..9d5f1c0 100644
--- a/crates/ezidam/src/routes/oauth/authorize.rs
+++ b/crates/ezidam/src/routes/oauth/authorize.rs
@@ -2,8 +2,11 @@ use crate::routes::prelude::*;
use apps::App;
use authorization_codes::AuthorizationCode;
use hash::SecretString;
+use rocket::http::{Cookie, CookieJar, SameSite};
+use rocket::time::Duration;
use rocket::{get, post};
use settings::Settings;
+use users::totp_login_request::{TOTP_REQUEST_COOKIE_NAME, TOTP_REQUEST_LEN};
use users::User;
#[get("/oauth/authorize?