Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jakedoublev committed May 3, 2024
1 parent 9ae52f8 commit 0122ddd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,15 @@ type ClientCreds struct {
ClientSecret string `json:"clientSecret"`
}

// Retrieves credentials by reading specified file
func GetClientCredsFromFile(filepath string) (ClientCreds, error) {
creds := ClientCreds{}
// read the file, parse the JSON, and return the client ID and secret
f, err := os.Open(filepath)
if err != nil {
return creds, errors.Join(errors.New("failed to open creds file"), err)
}
defer f.Close()

// read the file
if err := json.NewDecoder(f).Decode(&creds); err != nil {
return creds, errors.Join(errors.New("failed to decode creds file"), err)
}
Expand Down

0 comments on commit 0122ddd

Please sign in to comment.