grim/devweb
Clone
Summary
Browse
Changes
Graph
Remove api_key_access_key from the books_version table as it really isn't necessary
draft
default
tip
2021-01-25, Gary Kramlich
533ca8fcc53b
Remove api_key_access_key from the books_version table as it really isn't necessary
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
}