Buy Now and unlock this series
$
49
.99
$
29
.99
yours forever
$
49
.99
$
29
.99
Become a Pro and unlock everything
$
24
.99
per month
$
24
.99
Implementing CORS
Now that we know what CORS is, let's implement it in our project.
npm install --save fastify-cors
Downloads
Become a pro to download code and videos
Level 2 Node Authentication
23 videos
Released: March 31 2021Course Instructor
Scott Tolinski
- Getting Started
7m4s - Secure Cookies
6m47s - Hosts File
4m28s - Local SSL With Caddy Server
7m11s - Cookies In Safari
6m34s - Separate UI and API
11m25s - What Is CORS
4m30s - Implementing CORS
null - Sending Email
18m51s - Create Verify Email Link
18m41s - More Complex UI Server
15m16s - Verify Password Server Route
15m16s - Password Verification
15m12s - Change Password
26m8s - Fixing Logout
6m37s - Forgot Password Flow
29m56s - Reset Password UI
16m25s - Reset Password Server
26m8s - Authenticator 2FA UI
22m59s - Authenticator Tokens and Validation
21m23s - Authenticator Register
8m35s - Authenticator Login
25m5s - Where To Go From Here
5m34s
Comments
Mark Volkmann
over 1 year ago
I found the cause of the cookies not being send to my logout service. I'm sending a GET request instead of a POST since no body data is needed. But I forgot to pass the
credentials: 'include'
option to thefetch
function. After adding that, the cookies are being passed.Sepp Wikramaratna-Clarke
over 1 year ago
@Mark Volkmann you're jumping ahead i think =)
https://www.leveluptutorials.com/tutorials/level-2-node-authentication/fixing-logout
Mark Volkmann
over 1 year ago
After making all the changes up to this point, my API service for logging out no longer receives any cookies. Since I don't get the refresh-token, I can't find the session and delete it. I do see the access-token and refresh-token in the browser DevTools. The both have the domain ".nodeauth.dev". Note the period at the beginning. Is that the expected domain value? Should it be "api.nodeauth.dev" instead? Do I need to change the value of ROOT_DOMAIN in my .env file from "nodeauth.dev" to "api.nodeauth.dev"?
Want to join the conversation?
Become a Pro member today!