This commit is contained in:
2024-07-02 03:48:58 +05:30
parent e600bdd4f2
commit 9d583c0dc9

View File

@@ -19,3 +19,16 @@ pub fn (mut app App) post_signup(username string, email string, password string)
return app.json(noti)
}
@['/login'; post]
pub fn (mut app App) post_login(username string, password string) vweb.Result{
user := app.service_login(username, password) or {
mut noti := Noti{
status: "failure",
message: err.str()
}
return app.json(noti)
}
return app.json(user)
}