mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
Move nextcloud_login to frontend crate
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
@@ -26,6 +26,7 @@ use std::sync::Arc;
|
||||
|
||||
mod assets;
|
||||
mod config;
|
||||
pub mod nextcloud_login;
|
||||
mod oidc;
|
||||
mod routes;
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
@@ -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
|
||||
@@ -1,2 +0,0 @@
|
||||
[general]
|
||||
dirs = ["public/templates"]
|
||||
@@ -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>
|
||||
@@ -1,4 +1,4 @@
|
||||
use super::{AuthenticationProvider, User};
|
||||
use super::AuthenticationProvider;
|
||||
use actix_session::Session;
|
||||
use actix_web::{
|
||||
FromRequest, HttpMessage,
|
||||
|
||||
Reference in New Issue
Block a user