mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
chore: Clippy fixes
This commit is contained in:
@@ -286,7 +286,7 @@ pub(crate) async fn deactivate_route(
|
||||
// Prompt the user to confirm with their password using UIAA
|
||||
let _ = services
|
||||
.uiaa
|
||||
.authenticate_password(&body.auth, &sender_user, identity.sender_device(), None)
|
||||
.authenticate_password(&body.auth, sender_user, identity.sender_device(), None)
|
||||
.await?;
|
||||
|
||||
// Remove profile pictures and display name
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::{
|
||||
use base64::Engine;
|
||||
use conduwuit::{Result, utils::hash::sha256};
|
||||
use database::{Deserialized, Json, Map};
|
||||
use ruma::{DeviceId, OwnedUserId, UserId};
|
||||
use ruma::DeviceId;
|
||||
|
||||
use crate::{Dep, config, oauth::client_metadata::ClientMetadata};
|
||||
|
||||
@@ -36,6 +36,7 @@ pub enum OAuthTicket {
|
||||
impl OAuthTicket {
|
||||
const MAX_AGE: Duration = Duration::from_mins(10);
|
||||
|
||||
#[must_use]
|
||||
pub fn ticket_issue_path(&self) -> &'static str {
|
||||
match self {
|
||||
| Self::CrossSigningReset => "/account/cross_signing_reset",
|
||||
|
||||
@@ -83,8 +83,8 @@ enum UiaaSessionMetadata {
|
||||
impl UiaaSessionMetadata {
|
||||
fn into_identity(self) -> Identity {
|
||||
match self {
|
||||
| UiaaSessionMetadata::Legacy { identity } => identity,
|
||||
| UiaaSessionMetadata::OAuth { localpart, .. } =>
|
||||
| Self::Legacy { identity } => identity,
|
||||
| Self::OAuth { localpart, .. } =>
|
||||
assign!(Identity::default(), { localpart: Some(localpart) }),
|
||||
}
|
||||
}
|
||||
@@ -98,10 +98,12 @@ pub struct UiaaInitiator<'a> {
|
||||
}
|
||||
|
||||
impl<'a> UiaaInitiator<'a> {
|
||||
#[must_use]
|
||||
pub fn new(user_id: &'a UserId, device_id: Option<&'a DeviceId>) -> Self {
|
||||
Self { user_id, device_id, oauth_ticket: None }
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_oauth_ticket(
|
||||
user_id: &'a UserId,
|
||||
device_id: Option<&'a DeviceId>,
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
use axum::{Router, extract::State, routing::on};
|
||||
use conduwuit_api::client::full_user_deactivate;
|
||||
use conduwuit_service::oauth::OAuthTicket;
|
||||
use futures::StreamExt;
|
||||
use ruma::{OwnedRoomId, OwnedUserId, UserId};
|
||||
use serde::Deserialize;
|
||||
use tower_sessions::Session;
|
||||
use validator::{Validate, ValidationError, ValidationErrors};
|
||||
|
||||
|
||||
@@ -11,9 +11,8 @@ use ruma::{
|
||||
OwnedUserId,
|
||||
api::client::uiaa::{EmailUserIdentifier, MatrixUserIdentifier, UserIdentifier},
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde::Deserialize;
|
||||
use tower_sessions::Session;
|
||||
use validator::Validate;
|
||||
|
||||
use crate::{
|
||||
WebError,
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
use axum::{
|
||||
Router,
|
||||
extract::State,
|
||||
response::{IntoResponse, Response},
|
||||
routing::get,
|
||||
};
|
||||
use axum::{Router, extract::State, response::Response, routing::get};
|
||||
use conduwuit_service::threepid::EmailRequirement;
|
||||
use futures::StreamExt;
|
||||
use ruma::{OwnedClientSecret, OwnedSessionId};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use askama::{Template, filters::HtmlSafe};
|
||||
use validator::{ValidationError, ValidationErrors};
|
||||
use validator::ValidationErrors;
|
||||
|
||||
/// A reusable form component with field validation.
|
||||
#[derive(Debug, Template)]
|
||||
|
||||
@@ -116,9 +116,11 @@ impl DeviceCard {
|
||||
let display_name = oauth_metadata
|
||||
.as_ref()
|
||||
.and_then(|metadata| metadata.client_name.clone())
|
||||
.or(device
|
||||
.as_ref()
|
||||
.and_then(|device| device.display_name.clone()));
|
||||
.or_else(|| {
|
||||
device
|
||||
.as_ref()
|
||||
.and_then(|device| device.display_name.clone())
|
||||
});
|
||||
|
||||
let avatar_src = oauth_metadata
|
||||
.as_ref()
|
||||
|
||||
@@ -35,7 +35,6 @@ macro_rules! template {
|
||||
) => {
|
||||
#[derive(Debug, askama::Template)]
|
||||
#[template(path = $path)]
|
||||
#[allow(clippy::useless_let_if_seq)]
|
||||
struct $name$(<$lifetime>)? {
|
||||
context: $crate::pages::TemplateContext,
|
||||
$($field_name: $field_type,)*
|
||||
|
||||
@@ -5,13 +5,12 @@ Reset your password
|
||||
{%- endblock -%}
|
||||
|
||||
{%- block content -%}
|
||||
{% decl body_class -%}
|
||||
{% if let ResetPasswordRequestBody::Unavailable = body -%}
|
||||
{% let body_class = "panel middle" -%}
|
||||
{% else -%}
|
||||
{% let body_class = "panel" -%}
|
||||
{% endif -%}
|
||||
<div class="{{ body_class }}">
|
||||
{% match body %}
|
||||
{% when ResetPasswordRequestBody::Form(_) %}
|
||||
<div class="panel">
|
||||
{% when ResetPasswordRequestBody::Unavailable %}
|
||||
<div class="panel middle"/>
|
||||
{% endmatch %}
|
||||
<h1>Reset your password</h1>
|
||||
{% match body %}
|
||||
{% when ResetPasswordRequestBody::Form(form) %}
|
||||
|
||||
Reference in New Issue
Block a user