Still trying to just link some stuff bro
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
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
|
||||
}
|
||||
Reference in a new issue