feat: add error if token is nil
continuous-integration/drone/push Build is passing Details

main
RaviAnand Mohabir 1 year ago
parent e73da1d4fe
commit 5b8b05feef

@ -75,6 +75,10 @@ func GetSpotifyClient(ctx context.Context, app *core.App, user *models.User) (*s
} }
func SaveUserToken(ctx context.Context, app *core.App, spotifyID string, token *oauth2.Token) (*models.User, error) { func SaveUserToken(ctx context.Context, app *core.App, spotifyID string, token *oauth2.Token) (*models.User, error) {
if token == nil {
return nil, fmt.Errorf("token is nil")
}
coll := app.MongoClient.Database("listy").Collection("users") coll := app.MongoClient.Database("listy").Collection("users")
result, err := GetUser(ctx, app, spotifyID) result, err := GetUser(ctx, app, spotifyID)

Loading…
Cancel
Save