Add database to server endpoints, move modals, add forget pw to db
All checks were successful
Build Crate / build (push) Successful in 1m45s

This commit is contained in:
2024-08-27 02:12:57 -04:00
parent 242f9b1218
commit f4f491085d
17 changed files with 137 additions and 61 deletions

View File

@@ -1,11 +1,21 @@
// (Server only) Routes
use crate::endpoints::{LOGIN, LOGIN_TEST};
use crate::endpoints::{FORGOT_PASSWORD, LOGIN, LOGIN_TEST};
use axum::routing::{post, Router};
use futures::executor::block_on;
use sea_orm::Database;
use super::auth::login::{post_login_user, post_test_login};
use super::{
auth::{
forgot_password::post_forgot_password,
login::{post_login_user, post_test_login},
},
server_state::ServerState,
};
pub fn register_routes(app: Router) -> Router {
let app = app.route(LOGIN, post(post_login_user));
let app = app.route(LOGIN_TEST, post(post_test_login));
app
pub fn get_api_router(state: ServerState) -> Router {
Router::new()
.route(LOGIN, post(post_login_user))
.route(LOGIN_TEST, post(post_test_login))
.route(FORGOT_PASSWORD, post(post_forgot_password))
.with_state(state)
}