grim/devweb
Clone
Summary
Browse
Changes
Graph
clean up a bunch of random stuff
draft
2021-01-23, Gary Kramlich
b0674226270e
clean up a bunch of random stuff
package
access
import
(
"fmt"
"keep.imfreedom.org/grim/devweb/db"
)
func
Authenticate
(
username
,
password
string
)
error
{
apiKey
,
err
:=
db
.
FindAPIKey
(
username
)
if
err
!=
nil
{
return
err
}
if
password
!=
apiKey
.
SecretKey
{
return
fmt
.
Errorf
(
"invalid credentials"
)
}
return
nil
}