mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 13:16:56 +00:00
chore: fix up
This commit is contained in:
1 parent
b9b3a466f4
commit
0c333c9a05
5 files changed
+19
-30
No files matched your search
@@ -39,10 +39,7 @@ pub(crate) async fn authorize(
|
||||
}
|
||||
|
||||
// Redirect to the login page if no token or token not known.
|
||||
let hostname = services
|
||||
.config
|
||||
.server_name
|
||||
.host();
|
||||
let hostname = services.config.server_name.host();
|
||||
match oauth.authorization_header() {
|
||||
| None => {
|
||||
return Ok(oidc_login_form(hostname, &query));
|
||||
|
||||
@@ -5,12 +5,9 @@ use axum::extract::State;
|
||||
use conduwuit::Result;
|
||||
use ruma::{
|
||||
api::client::{
|
||||
discovery::get_authorization_server_metadata::{
|
||||
self,
|
||||
msc2965::{
|
||||
AccountManagementAction, AuthorizationServerMetadata, CodeChallengeMethod,
|
||||
GrantType, Prompt, ResponseMode, ResponseType,
|
||||
},
|
||||
discovery::get_authorization_server_metadata::msc2965::{
|
||||
self, AccountManagementAction, AuthorizationServerMetadata, CodeChallengeMethod,
|
||||
GrantType, Prompt, ResponseMode, ResponseType,
|
||||
},
|
||||
error::{
|
||||
Error as ClientError, ErrorBody as ClientErrorBody, ErrorKind as ClientErrorKind,
|
||||
@@ -92,5 +89,5 @@ pub(crate) async fn get_auth_metadata(
|
||||
};
|
||||
let metadata = Raw::new(&metadata).expect("authorization server metadata should serialize");
|
||||
|
||||
Ok(RumaResponse(Response::new(metadata)))
|
||||
Ok(RumaResponse(msc2965::Response::new(metadata)))
|
||||
}
|
||||
@@ -27,10 +27,7 @@ pub(crate) async fn oidc_login(
|
||||
if !services.users.exists(&user_id).await {
|
||||
return Err(err!(Request(Unknown("unknown username"))));
|
||||
}
|
||||
let valid_hash = services
|
||||
.users
|
||||
.password_hash(&user_id)
|
||||
.await?;
|
||||
let valid_hash = services.users.password_hash(&user_id).await?;
|
||||
|
||||
if valid_hash.is_empty() {
|
||||
return Err(err!(Request(UserDeactivated("the user's hash was not found"))));
|
||||
@@ -40,10 +37,7 @@ pub(crate) async fn oidc_login(
|
||||
}
|
||||
tracing::info!("logging in: {user_id:?}");
|
||||
|
||||
let hostname = services
|
||||
.config
|
||||
.server_name
|
||||
.host();
|
||||
let hostname = services.config.server_name.host();
|
||||
let authorization_query: AuthorizationQuery = query.into();
|
||||
|
||||
services
|
||||
|
||||
@@ -62,7 +62,8 @@ pub struct Config {
|
||||
/// See the docs for reverse proxying and delegation:
|
||||
/// https://continuwuity.org/deploying/generic.html#setting-up-the-reverse-proxy
|
||||
///
|
||||
/// Also see the `[global.auth]` and `[global.well_known]` config sections at the very bottom.
|
||||
/// Also see the `[global.auth]` and `[global.well_known]` config sections
|
||||
/// at the very bottom.
|
||||
///
|
||||
/// Examples of delegation:
|
||||
/// - https://puppygock.gay/.well-known/matrix/server
|
||||
@@ -2035,7 +2036,7 @@ pub struct AuthConfig {
|
||||
/// Unset by default.
|
||||
pub enable_oidc_login: bool,
|
||||
|
||||
/// Whether this homeserver should provide users with an account management
|
||||
/// Whether this homeserver should provide users with an account management
|
||||
/// interface. Only used if `enable_oidc_login` is set. Note that the
|
||||
/// endpoint is unimplemented at the moment.
|
||||
/// Unset by default.
|
||||
|
||||
Reference in new issue
Block a user