- The auth.js at the root of the directory contains the functions/functionalities provided by Auth JS lib
- the functions used are signin, signout, handlers(for handling http requests such as GET and POST), and auth(contains session information/metadata such as username)
- The auth, signIn, signOut functions are added as the action to be performed on login page in the the sepcific (personally created {learned abot in another video}) file
lib/actions/auth.js - The handlers function is used in
app\api\auth\[...nextauth]\route.jsfile - The route.js file handles all the requests to /api/auth/* (meaning all the requests for authentications)
- The repo contains client side logs as well (for debugging), hence not suitable for production.
Note: The [...nextauth] part is a dynamic API route. In Next.js, square brackets ([...]) denote a catch-all route parameter