user-auth store frontend and backend

This commit is contained in:
2022-12-31 21:52:09 +05:30
parent 40bb4f688a
commit aa1172bbc0
3 changed files with 145 additions and 26 deletions

View File

@@ -254,6 +254,7 @@ pub async fn main() {
.route("/api/create", post(create_book))
.route("/api/update", post(update_book))
.route("/api/delete/:id", get(delete_book))
.route("/api/authentication_check", get(authentication_check))
.route_layer(RequireAuthorizationLayer::<booksman_orm::AxumUser>::login())
.route("/api/list", get(list_book))
.route("/api/list_search", get(list_search_book))
@@ -346,6 +347,12 @@ async fn list_users(
auth.logout().await;
}
//https://openlibrary.org/api/books?bibkeys=ISBN:9780980200447&jscmd=data&format=json
async fn authentication_check(
Extension(user): Extension<booksman_orm::AxumUser>,
) -> impl IntoResponse {
return true;
}
//https://openlibrary.org/api/books?bibkeys=ISBN:9780980200447&jscmd=data&format=json