Darealtube / japhil-project

This is the OFFICIAL repository for the JAPHIL project.
japhil-project.vercel.app
2 stars 0 forks source link

Login and Register Authentication #1

Open Darealtube opened 3 years ago

Darealtube commented 3 years ago

Login and Register Authentication and Authorization

We already have a Login page found in `pages/index.tsx` and also a Register page in pages/register.tsx`.
All we need now is a kind or method of Authentication and Authorization of users, we will worry about **Sessions** for later.

We will have to choose a way of Authentication

Auth0, JWT tokens, and many more that might do the trick.



Darealtube commented 3 years ago

This is now completed with the use of Auth0. Auth0 will handle both the Authentication and the Authorization process in our website. Although it will get pricy the more users we have, the profit will pay off. If anyone of you have found something that's cheaper, add another Issue.

Darealtube commented 3 years ago

I have switched from Auth0, which is a paid authentication service that we used to implement, to NextAuth.js, an Open Source authentication system. I will list the Pros and Cons of each one, so hopefully we'll be able to finalize our decision.

Darealtube commented 3 years ago

AUTH0 VS NEXT-AUTH

AUTH0 and NEXT-AUTH are both Authentication Services that provide secure and safe Authentication on Browsers. This is going to compare the two so we can decide on what Authentication Service we should use.

AUTH0

Pros

Cons

NEXT-AUTH

Pros

Cons

Right now, I've implemented NextAuth into our website, because of its advantages over the Auth0 Free plan, and because it made some things so much easier, I even got to delete alot of files that I needed for Auth0. It is not an easy choice, because we must think of our Auth in the long term. Auth0 in the long term depends on how well the website is doing, how much money is getting generated, how many users are getting active every month, etc. NextAuth in the long term depends on how well will the Source Code get maintained and be safe from possible attacks, although we can actually add features on our NextAuth if we wanted to since Auth0 is only open source, we can add more features to our NextAuth. It is not an easy decision to make, but it's good if we establish a solid one.

For more info on each Authentication Service, check out these sites:

Auth0 Pricing

https://auth0.com/pricing/

Auth0 Features

https://auth0.com/security https://auth0.com/authentication

NextAuth Features

https://next-auth.js.org/ https://next-auth.js.org/faq#security

Comments:

I actually really like both Auth0 and NextAuth, but the only thing I'm worried about is if we use Auth0, the price for the paid plan may not be maintained, so it all depends on the performance and how well our website would do in the long run. If we use NextAuth on the other hand, we can cover things that Auth0 does not provide on the Free plan, such as Passwordless and having our own Database, but I have a sense of uncertainty because aside from those, there isn't really much documentation on NextAuth, and we need all kinds of protection that Auth0 offers, but I don't know for sure if NextAuth implements those as well.