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