33
This commit is contained in:
@@ -18,4 +18,17 @@ pub fn (mut app App) post_signup(username string, email string, password string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return app.json(noti)
|
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)
|
||||||
}
|
}
|
Reference in New Issue
Block a user