Matdweb / Jamming

This project allows you 👥 to create and customize 🎨 playlists 🎼 and send them to your Spotify account using API technology.
https://jamming-sooty.vercel.app
MIT License
0 stars 1 forks source link

Create Sign In functionality #2

Closed Matdweb closed 1 year ago

Matdweb commented 1 year ago

This application must use user authentication. For this we will use the tool NextAuth, you can learn more here.

NextAuth

This tool helps developers setup very easily user authentication for the app. This also comes with the possibility to use providers and setup authentication with a specific service (in this case we'll use the Spotify auth provider, learn more here). This way the Spotify API can also recognize that we have permissions from the user to interact with its account. (Interactions such as 'creating a new playlists')

Authentication process

As we mention is fundamental that we have user permissions.

Now, how do we use this permission in our app to successfully make some API requests?

Well, when a user is successfully authenticated in our application the same NextAuth tool will provide us with a session object on which we will have some critical information. We have access to this object on client components! One of the pieces of information this session object provides is an access token. This token will allow to interact with the user Spotify account with the Spotify API.

Important

For this PR is essential that the page establish clearly: