mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-20 23:47:33 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58026816f2 |
No files matched your search
@@ -1 +0,0 @@
|
||||
A message is now sent to the admin room when a user logs in for the first time through an OIDC provider, if admin room notices are enabled. Contributed by @ginger.
|
||||
@@ -1,4 +1,4 @@
|
||||
use std::{collections::HashMap, net::IpAddr, str::FromStr, sync::Arc, time::Duration};
|
||||
use std::{collections::HashMap, str::FromStr, sync::Arc, time::Duration};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{
|
||||
@@ -359,7 +359,6 @@ impl Service {
|
||||
&self,
|
||||
claims: &Claims,
|
||||
supplied_user_id: Option<OwnedUserId>,
|
||||
client_ip: &IpAddr,
|
||||
) -> Result<SessionCompletionStatus, &'static str> {
|
||||
let Some(OidcClient { config, .. }) = self.client.as_ref() else {
|
||||
return Err("Delegated authentication is not enabled on this server.");
|
||||
@@ -420,7 +419,7 @@ impl Service {
|
||||
// Create a new shadow user
|
||||
self.services
|
||||
.users
|
||||
.create_local_account(&user_id, None, None, Some(client_ip), None)
|
||||
.create_local_account(&user_id, None, None, None, None)
|
||||
.await
|
||||
.map_err(|err| {
|
||||
error!("Failed to create a shadow user for {user_id}: {err}");
|
||||
|
||||
@@ -6,7 +6,6 @@ use axum::{
|
||||
response::Redirect,
|
||||
routing::on,
|
||||
};
|
||||
use conduwuit_api::client_ip::ClientIp;
|
||||
use conduwuit_service::{
|
||||
oauth::grant::AuthorizationCodeResponse,
|
||||
oidc::{ClaimedLocalUser, SessionCompletionStatus},
|
||||
@@ -64,7 +63,6 @@ async fn route_complete(
|
||||
Expect(Query(query)): Expect<Query<AuthorizationCodeResponse>>,
|
||||
session_store: Session,
|
||||
user: User<true>,
|
||||
ClientIp(client_ip): ClientIp,
|
||||
PostForm(form): PostForm<LoginForm>,
|
||||
) -> Result {
|
||||
let user_id = user.into_session().map(|session| session.user_id);
|
||||
@@ -106,10 +104,7 @@ async fn route_complete(
|
||||
.await
|
||||
.expect("should be able to serialize oidc session");
|
||||
|
||||
services
|
||||
.oidc
|
||||
.complete_session(&claims, None, &client_ip)
|
||||
.await
|
||||
services.oidc.complete_session(&claims, None).await
|
||||
},
|
||||
| OidcSessionState::Authorized { claims } => {
|
||||
let supplied_user_id = if let Some(form) = form {
|
||||
@@ -168,7 +163,7 @@ async fn route_complete(
|
||||
|
||||
services
|
||||
.oidc
|
||||
.complete_session(&claims, supplied_user_id, &client_ip)
|
||||
.complete_session(&claims, supplied_user_id)
|
||||
.await
|
||||
},
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{% if style != DeviceCardStyle::Detailed %}
|
||||
<a href="{{ crate::ROUTE_PREFIX }}/account/device/{{ device_id }}/">Details</a>
|
||||
<a href="{{ crate::ROUTE_PREFIX }}/account/device/{{ device_id | urlencode_strict }}/">Details</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in new issue
Block a user