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

main
RaviAnand Mohabir 11 months 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) {
if token == nil {
return nil, fmt.Errorf("token is nil")
}
coll := app.MongoClient.Database("listy").Collection("users")
result, err := GetUser(ctx, app, spotifyID)

Loading…
Cancel
Save