vieter/src/auth.v

12 lines
232 B
Coq
Raw Normal View History

2022-01-11 21:18:33 +01:00
module main
import net.http
fn (mut app App) is_authorized() bool {
x_header := app.req.header.get_custom('X-Api-Key', http.HeaderQueryConfig{ exact: true }) or {
return false
}
return x_header.trim_space() == app.api_key
}