@astro-auth/providers
Version:
The providers package of the Astro Auth library
24 lines (23 loc) • 822 B
JavaScript
const SpotifyProvider = (options) => {
return {
id: "spotify",
name: "Spotify",
type: "oauth",
scope: "user-read-email",
options,
authorization: "https://accounts.spotify.com/authorize",
token: "https://accounts.spotify.com/api/token",
userinfo: "https://api.spotify.com/v1/me",
profile(profile) {
var _a, _b;
return {
id: profile.id,
name: profile.display_name,
email: profile.email,
image: (_b = (_a = profile.images) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url,
originalUser: Object.assign({}, profile),
};
},
};
};
export default SpotifyProvider;