mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 10:35:39 +00:00
feat: migrate v1 api mod to use actix_auth_middleware
This commit is contained in:
@@ -24,7 +24,7 @@ use crate::AppData;
|
||||
|
||||
#[my_codegen::post(
|
||||
path = "crate::V1_API_ROUTES.account.delete",
|
||||
wrap = "crate::CheckLogin"
|
||||
wrap = "crate::api::v1::get_middleware()"
|
||||
)]
|
||||
pub async fn delete_account(
|
||||
id: Identity,
|
||||
|
||||
@@ -55,7 +55,7 @@ pub async fn email_exists(
|
||||
/// update email
|
||||
#[my_codegen::post(
|
||||
path = "crate::V1_API_ROUTES.account.update_email",
|
||||
wrap = "crate::CheckLogin"
|
||||
wrap = "crate::api::v1::get_middleware()"
|
||||
)]
|
||||
async fn set_email(
|
||||
id: Identity,
|
||||
|
||||
@@ -70,7 +70,7 @@ async fn update_password_runner(
|
||||
|
||||
#[my_codegen::post(
|
||||
path = "crate::V1_API_ROUTES.account.update_password",
|
||||
wrap = "crate::CheckLogin"
|
||||
wrap = "crate::api::v1::get_middleware()"
|
||||
)]
|
||||
async fn update_user_password(
|
||||
id: Identity,
|
||||
|
||||
@@ -31,7 +31,7 @@ pub struct Secret {
|
||||
|
||||
#[my_codegen::get(
|
||||
path = "crate::V1_API_ROUTES.account.get_secret",
|
||||
wrap = "crate::CheckLogin"
|
||||
wrap = "crate::api::v1::get_middleware()"
|
||||
)]
|
||||
async fn get_secret(id: Identity, data: AppData) -> ServiceResult<impl Responder> {
|
||||
let username = id.identity().unwrap();
|
||||
@@ -49,7 +49,7 @@ async fn get_secret(id: Identity, data: AppData) -> ServiceResult<impl Responder
|
||||
|
||||
#[my_codegen::post(
|
||||
path = "crate::V1_API_ROUTES.account.update_secret",
|
||||
wrap = "crate::CheckLogin"
|
||||
wrap = "crate::api::v1::get_middleware()"
|
||||
)]
|
||||
async fn update_user_secret(
|
||||
id: Identity,
|
||||
|
||||
@@ -67,7 +67,7 @@ pub struct Username {
|
||||
/// update username
|
||||
#[my_codegen::post(
|
||||
path = "crate::V1_API_ROUTES.account.update_username",
|
||||
wrap = "crate::CheckLogin"
|
||||
wrap = "crate::api::v1::get_middleware()"
|
||||
)]
|
||||
async fn set_username(
|
||||
id: Identity,
|
||||
|
||||
Reference in New Issue
Block a user