
Learn to authenticate with react in typescript, connect to a database with migrations, generate JWT tokens, and implement forgot and reset password flows via email.
Install Deno from the main page, explore library modules, run the getting started example, and set up a simple hello world server with allow-net permissions.
Import the deno router from a url, add get endpoints for the homepage and a new page, return 'Homepage' and 'New Age', and run on port 8000.
Set up Denon to monitor changes, auto-restart the server, and tailor the configuration to watch specific files and folders (src and source) for smoother React and Deno.js development.
Implement a register endpoint in the OAuth controller by handling a post request to /api/register with content type application/json, parsing request parameters, and preparing to store them in a database.
The guide walks through configuring a database connection with Coton, creating and running migrations, and defining a users table with first name, last name, email, and password.
Apply the repository pattern to user data in a React and Deno.js setup by building an abstract repository, extending it with a user repository, and streamlining database access.
Create a login function that uses a request context and user repository to verify email and hashed password, handle not found and unauthorized cases, and prepare for JWT generation.
Generate a JWT using a secret key, a payload with the user id and issuer, and an expiration of one hour; store the token in an HttpOnly cookie for authentication.
Refactor authentication by introducing an auth helpers directory and a generate jwt function using the user id. Make the function asynchronous and prepare for future extension.
Implement an OAuth middleware in Deno and React app that validates JWTs from cookies, passes authenticated requests to the next handler, and returns an unauthenticated response for invalid tokens.
Extract the issuer from cookies, validate JWT, fetch the authenticated user by ID, and return a safe profile (first name, last name, email) while omitting the password.
Store keys as environment variables using an EMV file in Deno, then enable allow EMV and read the key from the environment, verifying it via logs.
Build a forgot password flow by creating a forgot controller, generating a 12-character token, migrating a password_reset table, storing email and token, and sending a reset email.
Install the mealybug made hoagies package, configure a mailhog smtp client on port 1025, and implement a mailer to send a reset password email containing a frontend link.
Implement a reset password flow with token validation, password and password confirm checks, find by token and email, update the user password, and return a success message.
Implement a logout function that deletes cookies to remove the JWT, and return a response whose body is the message, then test it in the front end.
Enable cross-origin requests by configuring cors in the Deno backend, importing the cors module, enabling credentials, and setting an origin regex that matches localhost ports for the React frontend.
Install React, create a React project with a TypeScript template, wait for the setup to complete, then navigate into the project folder and start the app.
Create a Bootstrap-styled authentication template in a React and deno.js project, clean the form markup, convert class to className, remove labels, and apply CSS tweaks for a cleaner UI.
Set up routes for login and register pages in a TypeScript React app, create login and register components with forms, and ensure exact path routing to render the home message.
Learn to implement a navigation component with Bootstrap styling and React Router links to connect login, register, and home pages across the app.
Build a React register form using useState to manage first name, last name, email, password, and password confirm; submit with axios to localhost:8000/api/register, handling preventDefault and processing the response.
Redirect to the login page after a successful registration by toggling a redirect state and using react-router-dom's Redirect, while updating axios defaults for consistent requests.
Create and manage email and password inputs, handle form submission, and post login with credentials; on success, redirect to the main page while addressing not logged in messages.
Fetch the current authenticated user using a user hook and axios. Enable cookie-based sessions by setting credentials and handle success and error cases to greet the user.
Lift the user state to the app component, pass the user to home and nav, display the email, and implement a logout action with axios post to sign out.
explains using useEffect dependencies to refresh user data after login or logout, showing the logout button and updating navigation based on login state.
Implement the forgot password flow by adding a forgot link and a component that collects the user email, posts via axios, and notifies on success when reset email is sent.
Build a reset password page in a React and Deno.js authentication flow, handling token, password, and password confirm, and submit to the backend before redirecting to login.
Learn how to authenticate using React and Deno.
In Deno you will learn:
Use Typescript
Create public and secure routes
Connect with MySQL
Run Migrations
Register Users
Generate Jwt Tokens
Use HttpOnly Cookies
Send Emails
In React you will learn:
Use Typescript
Create components and routes
Consume API calls
Use React Hooks
If these are what you are looking for then this course is for you.