spotifyProvider function

Implementation

OAuthProvider<SpotifyProfile> spotifyProvider(SpotifyProviderOptions options) {
  return OAuthProvider<SpotifyProfile>(
    id: 'spotify',
    name: 'Spotify',
    clientId: options.clientId,
    clientSecret: options.clientSecret,
    authorizationEndpoint: Uri.parse('https://accounts.spotify.com/authorize'),
    tokenEndpoint: Uri.parse('https://accounts.spotify.com/api/token'),
    userInfoEndpoint: Uri.parse('https://api.spotify.com/v1/me'),
    redirectUri: options.redirectUri,
    scopes: options.scopes,
    profileParser: SpotifyProfile.fromJson,
    profileSerializer: (profile) => profile.toJson(),
    profile: (profile) {
      return AuthUser(
        id: profile.id,
        name: profile.displayName,
        email: profile.email,
        image: profile.imageUrl,
        attributes: profile.toJson(),
      );
    },
  );
}