diff --git a/main.go b/main.go index 3cb0b5b..9ce193f 100644 --- a/main.go +++ b/main.go @@ -55,17 +55,7 @@ func log(message string, messageType library.MessageCode) { Information.SendISMessage(loggerService, messageType, message) } -// Authenticate Fake for testing -func Authenticate(_ string, _ OAuthConfig) (uuid.UUID, error) { - return uuid.MustParse("ef585ba0-0ac6-48f8-8ebb-2b6cd97d6a21"), nil -} - -// GetUsername Fake for testing -func GetUsername(_ string, _ OAuthConfig) (string, error) { - return "arzumify", nil -} - -func RAuthenticate(token string, config OAuthConfig) (uuid.UUID, error) { +func Authenticate(token string, config OAuthConfig) (uuid.UUID, error) { parsedToken, err := jwt.Parse(token, func(token *jwt.Token) (interface{}, error) { return config.PublicKey, nil }) @@ -90,7 +80,7 @@ func RAuthenticate(token string, config OAuthConfig) (uuid.UUID, error) { return uuid.MustParse(claims["sub"].(string)), nil } -func RGetUsername(token string, config OAuthConfig) (string, error) { +func GetUsername(token string, config OAuthConfig) (string, error) { var responseData struct { Username string `json:"username"` }