Refactor authentication handlers and middleware
This commit is contained in:
parent
024d63bb16
commit
bba6e8618a
5 changed files with 67 additions and 38 deletions
11
internal/auth/credentials.go
Normal file
11
internal/auth/credentials.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package auth
|
||||
|
||||
import "errors"
|
||||
|
||||
func (a *Authenticator) verifyCredentials(login, password string) error {
|
||||
|
||||
if login == "admin" && password == "secret" {
|
||||
return nil
|
||||
}
|
||||
return errors.New("wrong credentials")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue