1
0
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:
Yohann D'ANELLO
2021-01-08 22:23:33 +01:00
parent 7e0ee7aba5
commit e47aefd6df
4 changed files with 9 additions and 9 deletions

View File

@ -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