More fixes

This commit is contained in:
James Mills
2021-01-30 15:26:24 +10:00
parent 401f635b3b
commit 8495ba0319
8 changed files with 15 additions and 304 deletions

View File

@@ -2,8 +2,6 @@ package internal
import (
"encoding/json"
"fmt"
"net/url"
"time"
"github.com/creasty/defaults"
@@ -73,12 +71,7 @@ func LoadUser(data []byte) (user *User, err error) {
}
func (u *User) String() string {
url, err := url.Parse(u.URL)
if err != nil {
log.WithError(err).Warn("error parsing user url")
return u.Username
}
return fmt.Sprintf("%s@%s", u.Username, url.Hostname())
return u.Username
}
// HasToken will add a token to a user if it doesn't exist already