Allow HTTP OAuth in recovery mode
This commit is contained in:
@@ -170,9 +170,11 @@ impl OAuthApiHandler for Server {
|
||||
.is_some_and(|uri| uri.starts_with("http://"))
|
||||
{
|
||||
#[cfg(not(feature = "dev_mode"))]
|
||||
return Err(trc::AuthEvent::Error
|
||||
.into_err()
|
||||
.details("Redirect URI must be HTTPS."));
|
||||
if !self.registry().is_recovery_mode() {
|
||||
return Err(trc::AuthEvent::Error
|
||||
.into_err()
|
||||
.details("Redirect URI must be HTTPS."));
|
||||
}
|
||||
}
|
||||
|
||||
// Parse and validate PKCE challenge (RFC 7636).
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
use crate::{InMemoryStore, LookupStores, registry::bootstrap::Bootstrap};
|
||||
use crate::{LookupStores, registry::bootstrap::Bootstrap};
|
||||
use registry::schema::structs::{LookupStore, StoreLookup};
|
||||
use std::collections::hash_map::Entry;
|
||||
|
||||
@@ -28,18 +28,18 @@ impl LookupStores {
|
||||
LookupStore::PostgreSql(postgre_sql_store) => {
|
||||
crate::backend::postgres::PostgresStore::open(postgre_sql_store)
|
||||
.await
|
||||
.map(InMemoryStore::Store)
|
||||
.map(crate::InMemoryStore::Store)
|
||||
}
|
||||
#[cfg(feature = "mysql")]
|
||||
LookupStore::MySql(my_sql_store) => {
|
||||
crate::backend::mysql::MysqlStore::open(my_sql_store)
|
||||
.await
|
||||
.map(InMemoryStore::Store)
|
||||
.map(crate::InMemoryStore::Store)
|
||||
}
|
||||
#[cfg(feature = "sqlite")]
|
||||
LookupStore::Sqlite(sqlite_store) => {
|
||||
crate::backend::sqlite::SqliteStore::open(sqlite_store)
|
||||
.map(InMemoryStore::Store)
|
||||
.map(crate::InMemoryStore::Store)
|
||||
}
|
||||
// SPDX-SnippetBegin
|
||||
// SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <hello@stalw.art>
|
||||
|
||||
Reference in New Issue
Block a user