| 1 | module main |
| 2 | |
| 3 | import veb |
| 4 | |
| 5 | @['/controller/auth'; post] |
| 6 | pub fn (mut app App) controller_auth(mut ctx Context, username string, password string) veb.Result { |
| 7 | response := app.service_auth(username, password) or { |
| 8 | ctx.res.set_status(.bad_request) |
| 9 | return ctx.text('error: ${err}') |
| 10 | } |
| 11 | |
| 12 | return ctx.json(response) |
| 13 | } |
| 14 |