Improve redirect URI management
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::data::client::ClientID;
|
||||
use crate::data::entity_manager::EntityManager;
|
||||
use crate::data::login_redirect::LoginRedirect;
|
||||
use crate::data::totp_key::TotpKey;
|
||||
use crate::utils::err::Res;
|
||||
|
||||
@@ -27,10 +28,10 @@ impl TwoFactor {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn login_url(&self, redirect_uri: &str) -> String {
|
||||
pub fn login_url(&self, redirect_uri: &LoginRedirect) -> String {
|
||||
match self.kind {
|
||||
TwoFactorType::TOTP(_) => format!("/2fa_otp?id={}&redirect_uri={}",
|
||||
self.id.0, redirect_uri)
|
||||
self.id.0, redirect_uri.get_encoded())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user