grim/devweb

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
}