mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
chore: rust fmpt
This commit is contained in:
@@ -2,8 +2,10 @@ use std::sync::Arc;
|
||||
|
||||
use actix_web::test;
|
||||
use actix_web::{
|
||||
dev::ServiceResponse, error::ResponseError, http::StatusCode,
|
||||
body::{EitherBody, BoxBody},
|
||||
body::{BoxBody, EitherBody},
|
||||
dev::ServiceResponse,
|
||||
error::ResponseError,
|
||||
http::StatusCode,
|
||||
middleware as actix_middleware,
|
||||
};
|
||||
use libmcaptcha::defense::Level;
|
||||
@@ -110,7 +112,10 @@ pub async fn register(name: &str, email: &str, password: &str) {
|
||||
}
|
||||
|
||||
/// signin util
|
||||
pub async fn signin(name: &str, password: &str) -> (Arc<Data>, Login, ServiceResponse<EitherBody<BoxBody>>) {
|
||||
pub async fn signin(
|
||||
name: &str,
|
||||
password: &str,
|
||||
) -> (Arc<Data>, Login, ServiceResponse<EitherBody<BoxBody>>) {
|
||||
let data = Data::new().await;
|
||||
let app = get_app!(data.clone()).await;
|
||||
|
||||
@@ -173,7 +178,12 @@ pub fn get_level_data() -> CreateCaptcha {
|
||||
pub async fn add_levels_util(
|
||||
name: &str,
|
||||
password: &str,
|
||||
) -> (Arc<data::Data>, Login, ServiceResponse<EitherBody<BoxBody>>, MCaptchaDetails) {
|
||||
) -> (
|
||||
Arc<data::Data>,
|
||||
Login,
|
||||
ServiceResponse<EitherBody<BoxBody>>,
|
||||
MCaptchaDetails,
|
||||
) {
|
||||
let (data, creds, signin_resp) = signin(name, password).await;
|
||||
let cookies = get_cookie!(signin_resp);
|
||||
let app = get_app!(data).await;
|
||||
|
||||
Reference in New Issue
Block a user