Move nextcloud_login to frontend crate

This commit is contained in:
Lennart
2025-04-13 19:00:51 +02:00
parent a60d8deacc
commit 14e5533b6f
14 changed files with 18 additions and 75 deletions

View File

@@ -21,3 +21,6 @@ futures-core.workspace = true
hex.workspace = true
mime_guess.workspace = true
reqwest.workspace = true
rand.workspace = true
chrono.workspace = true
uuid.workspace = true

View File

@@ -17,6 +17,6 @@
{% if let Some(OidcProviderData {name, redirect_url}) = oidc_data %}
<a href="{{ redirect_url }}">Login with {{ name }}</a>
{% endif %}
{% endblock %}
</div>
{% endblock %}

View File

@@ -26,6 +26,7 @@ use std::sync::Arc;
mod assets;
mod config;
pub mod nextcloud_login;
mod oidc;
mod routes;

View File

@@ -1,11 +1,11 @@
use actix_web::{
HttpRequest, HttpResponse, Responder,
http::header::{self},
web::{self, Data, Form, Html, Json, Path, ServiceConfig},
HttpRequest, HttpResponse, Responder,
};
use askama::Template;
use chrono::{DateTime, Duration, Utc};
use rand::{distributions::Alphanumeric, Rng};
use rand::{Rng, distributions::Alphanumeric};
use rustical_store::auth::{AuthenticationMiddleware, AuthenticationProvider, User};
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, sync::Arc};
@@ -141,7 +141,7 @@ fn generate_app_token() -> String {
}
#[derive(Template)]
#[template(path = "pages/nextcloud_login_form.html")]
#[template(path = "pages/nextcloud_login/form.html")]
struct NextcloudLoginPage {
username: String,
app_name: String,
@@ -176,7 +176,7 @@ struct NextcloudAuthorizeForm {
}
#[derive(Template)]
#[template(path = "pages/nextcloud_login_success.html")]
#[template(path = "pages/nextcloud_login/success.html")]
struct NextcloudLoginSuccessPage {
app_name: String,
}

View File

@@ -1,23 +0,0 @@
[package]
name = "rustical_nextcloud_login"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
publish = false
[dependencies]
askama.workspace = true
actix-session = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
actix-web = { workspace = true }
rustical_store = { workspace = true }
rust-embed.workspace = true
futures-core.workspace = true
hex.workspace = true
mime_guess.workspace = true
rand.workspace = true
uuid.workspace = true
chrono.workspace = true

View File

@@ -1,2 +0,0 @@
[general]
dirs = ["public/templates"]

View File

@@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}RustiCal{% endblock %}</title>
{% block imports %}{% endblock %}
</head>
<body>
<div id="app">
{% block content %}<p>Placeholder</p>{% endblock %}
</div>
</body>
</html>

View File

@@ -1,4 +1,4 @@
use super::{AuthenticationProvider, User};
use super::AuthenticationProvider;
use actix_session::Session;
use actix_web::{
FromRequest, HttpMessage,