[
“””
let’s setup more robust user authentication.
First we need to implement Token-Based (JWT) session handling.
I have installed: npm install passport passport-google-oauth20 jsonwebtoken
Also I have added my GOOGLE_CLIENT_ID and GOOGLE_CLIENT_ID and JWT_SECRET to our .env file.
You must look at our current database schema, then add the routes for /login, /register and /auth/google and auth/google/callback
You will need to setup our Google passport strategy.
You will need to create our dedicated session and user handler scripts.
We will have traditional registration and login PLUS Google authentication.
So let’s setup our back-end user and session management and routes and database handlers for both.
First analyze the current code state and plan our steps.
Then proceed implementing our new user management / Google authentication / session handling systems.
“””
“””
Confirm the routes for our traditional and Google logins, registration and authentication are setup.
“””,
“””
let’s double check middleware for our login, registration and Google auth are setup.
“””,
“””
Check the database handlers are setup for our traditional and Google logins, registration and authentication.
“””,
“””
let’s focus on the session handling JWT token-based (stateless) auth is setup correctly.
“””,
“””
review the new user management and authentication full back-end for issues, fixes and improvements.
“””,
“””
final review
“””,
“””
great now update the client let’s add a dedicated page for logging in and registering, wire up the new page with standard registration/login inputs and google login option.
then let’s update the authentication section in client/controls to reflect the login status.
make certain these 3 new options matches our routes payloads and token process.
“””,
“””
ok proceed
“””,
“””
perform an end-to-end review of the login and registration system
“””,
“””
perform an end-to-end review of the google authentication system
“””,
“””
what can we do to improve our user management further?
“””
]
Leave a Reply