mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-27 19:12:07 +02:00
Replace the name of the stream if using an alias
This commit is contained in:
@ -23,15 +23,15 @@ type Basic struct {
|
||||
|
||||
// Login hashs password and compare
|
||||
// Returns (true, nil) if success
|
||||
func (a Basic) Login(username string, password string) (bool, error) {
|
||||
func (a Basic) Login(username string, password string) (bool, string, error) {
|
||||
hash, ok := a.Cfg.Credentials[username]
|
||||
if !ok {
|
||||
return false, errors.New("user not found in credentials")
|
||||
return false, "", errors.New("user not found in credentials")
|
||||
}
|
||||
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
|
||||
|
||||
// Login succeeded if no error
|
||||
return err == nil, err
|
||||
return err == nil, username, err
|
||||
}
|
||||
|
||||
// Close has no connection to close
|
||||
|
Reference in New Issue
Block a user