feat: migrate v1 api mod to use actix_auth_middleware

This commit is contained in:
realaravinth
2022-05-07 12:29:37 +05:30
parent b057e48d72
commit a668fafa62
17 changed files with 65 additions and 19 deletions

View File

@@ -15,7 +15,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use actix_auth_middleware::Authentication;
use actix_web::web::ServiceConfig;
use serde::Deserialize;
pub mod account;
pub mod auth;
@@ -36,5 +38,14 @@ pub fn services(cfg: &mut ServiceConfig) {
notifications::services(cfg);
}
#[derive(Deserialize)]
pub struct RedirectQuery {
pub redirect_to: Option<String>,
}
pub fn get_middleware() -> Authentication<routes::Routes> {
Authentication::with_identity(ROUTES)
}
#[cfg(test)]
mod tests;