grim/devweb
Clone
Summary
Browse
Changes
Graph
Move back to vue-cli
draft
2021-01-23, Gary Kramlich
72c85415b1e2
Move back to vue-cli
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
}