forked from vieter-v/vieter
Still trying to just link some stuff bro
This commit is contained in:
parent
cfcca90dfc
commit
05e725eb4e
11 changed files with 43 additions and 28 deletions
11
src/auth.v
Normal file
11
src/auth.v
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue