This commit is contained in:
JMARyA 2024-07-28 16:12:06 +02:00
parent 1e67f223f7
commit 0bdf75446d
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 58 additions and 2 deletions

View file

@ -53,7 +53,7 @@ impl User {
role,
};
u.insert().await.unwrap();
u.insert().await.ok()?;
Some(u)
}

View file

@ -5,6 +5,7 @@ mod route;
use rocket::routes;
use rocket::{http::Method, launch};
use library::user::{User, UserRole};
#[launch]
async fn rocket() -> _ {
@ -25,6 +26,8 @@ async fn rocket() -> _ {
lib.rescan().await;
User::create("admin", "admin", UserRole::Admin).await;
rocket::build()
.mount(
"/",
@ -35,7 +38,8 @@ async fn rocket() -> _ {
route::album::album_route,
route::track::track_route,
route::track::track_audio_route,
route::album::album_cover_route
route::album::album_cover_route,
route::user::login_route
],
)
.manage(lib)