change in confirm mechanism
This commit is contained in:
+1
-1
@@ -103,7 +103,7 @@ pub fn router(
|
||||
)
|
||||
.route(
|
||||
"/share-invitations/{token}/accept",
|
||||
get(auth::accept_share_invitation),
|
||||
get(home).post(auth::accept_share_invitation),
|
||||
)
|
||||
.route("/api/auth/password-reset", post(auth::request_reset))
|
||||
.route(
|
||||
|
||||
+2
-3
@@ -9,7 +9,6 @@ use axum::{
|
||||
Json,
|
||||
extract::{Path as AxumPath, State},
|
||||
http::{HeaderMap, StatusCode},
|
||||
response::Redirect,
|
||||
};
|
||||
use chrono::{Duration, Utc};
|
||||
use lettre::{
|
||||
@@ -1261,7 +1260,7 @@ pub async fn share_resource_users(
|
||||
pub async fn accept_share_invitation(
|
||||
State(state): State<SharedState>,
|
||||
AxumPath(token): AxumPath<String>,
|
||||
) -> Result<Redirect, AuthError> {
|
||||
) -> Result<Json<serde_json::Value>, AuthError> {
|
||||
let token_hash = hash_token(token.trim());
|
||||
let row: Option<(String, String, i64, String, String, Option<String>)> = sqlx::query_as(
|
||||
queries::get(state.db.kind(), queries::SHARE_INVITATION_FIND_TOKEN),
|
||||
@@ -1320,7 +1319,7 @@ pub async fn accept_share_invitation(
|
||||
} else {
|
||||
format!("/p/{slug}")
|
||||
};
|
||||
Ok(Redirect::to(&target))
|
||||
Ok(Json(serde_json::json!({"ok": true, "url": target})))
|
||||
}
|
||||
|
||||
pub async fn remove_resource_user(
|
||||
|
||||
Reference in New Issue
Block a user