Still trying to just link some stuff bro

This commit is contained in:
Jef Roosens 2022-01-12 20:54:54 +01:00
parent cfcca90dfc
commit 05e725eb4e
Signed by untrusted user: Jef Roosens
GPG key ID: 955C0660072F691F
11 changed files with 43 additions and 28 deletions

11
src/auth.v Normal file
View file

@ -0,0 +1,11 @@
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
}