mirror of
https://github.com/unmojang/drasl.git
synced 2025-08-03 19:06:04 -04:00
Actually do authentication :D
This commit is contained in:
parent
c4bc8aa6d2
commit
7b8411d69d
9
auth.go
9
auth.go
@ -90,6 +90,15 @@ func AuthAuthenticate(app *App) func(c echo.Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
passwordHash, err := HashPassword(req.Password, user.PasswordSalt)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if !bytes.Equal(passwordHash, user.PasswordHash) {
|
||||||
|
return c.JSONBlob(http.StatusUnauthorized, invalidCredentialsBlob)
|
||||||
|
}
|
||||||
|
|
||||||
var tokenPair TokenPair
|
var tokenPair TokenPair
|
||||||
accessToken, err := RandomHex(16)
|
accessToken, err := RandomHex(16)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user