mock auth
This commit is contained in:
@@ -7,6 +7,9 @@ pub mod items {
|
||||
include!(concat!(env!("OUT_DIR"), "/items.rs"));
|
||||
}
|
||||
|
||||
mod auth;
|
||||
mod proto_utils;
|
||||
|
||||
#[get("/<name>")]
|
||||
fn get_user(user_list: &rocket::State<Vec<items::Person>>, name: String) -> Option<items::Person> {
|
||||
user_list.iter().find(|user| user.name == name).cloned()
|
||||
@@ -53,6 +56,7 @@ fn rocket() -> _ {
|
||||
min_players: 1,
|
||||
max_players: 90,
|
||||
price: 0,
|
||||
remote_id: 0,
|
||||
}),
|
||||
would_play: true,
|
||||
}],
|
||||
@@ -60,7 +64,12 @@ fn rocket() -> _ {
|
||||
|
||||
rocket::build()
|
||||
.manage(user_list)
|
||||
.manage(auth::AuthState::new())
|
||||
.mount("/api", routes![get_users, get_user])
|
||||
.mount(
|
||||
"/auth",
|
||||
routes![auth::login, auth::logout, auth::get_auth_status],
|
||||
)
|
||||
.mount("/", routes![index_fallback])
|
||||
.mount("/", FileServer::new("../frontend/dist"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user