Next.js 13 Full Stack E-commerce App #15 | Protect API Endpoints, Pass Next Auth Token with Axios

preview_player
Показать описание
Git Repo Link:

================================================================

⚙️ Gadgets I use for Recording:

💻 Laptop - Macbook PRO M1 - 16/512

🎤 MIC - Samson Technologies Q2U USB/XLR Dynamic Microphone

🖱️Mouse - Logitech G402 Gaming Mouse Hyperion Fury USB, Black

⌨️ Keyboard - Logitech K380 Multi-Device Bluetooth Keyboard

🖥️ Monitor - UltraSharp 24-Inch Screen Led-Lit Monitor (U2419H)

================================================================

Next, we delve into the process of passing Next Auth tokens with Axios. We explain how to retrieve and use the Next Auth token within our application, as well as how to configure Axios to include the token in each request.

Thanks for watching, and let's get started!
Рекомендации по теме
Комментарии
Автор

Man I love this series, only downsight is that I will have to wait weeks untill all videos of the series are online. Love this project and what you doing!

Military
Автор

So if i try to create a new address, i get error in the terminal and in the console 401 ( Unauthorized ).

ecosander
Автор

Hi, Can you use the Axios interceptors to set the cookies before requesting the API route and write all API calls for frontend in single file on frontend part?
I want video on it, please

talhaSohail-mf
Автор

const session = await getSession({ req })

i'm not getting session what should i do

mdbadhon
Автор

Hi Sir, how you are creating new address without passing jwt token in axios post request (in addNewAddress function)? where as your api end point is protected @Coding With Abbas

aamirrashid
Автор

When on second page and then applying a filter on the products the page will remain on page 2 with the applied filter (where there are no products anymore on page 2, but there are on page 1) How can you reset the page count without affecting the pagination method so after applying a filter with a checkbox the page is reseted to 1 or completely removed?

Military
Автор

i love this series. i have learn a lot, thank you

ibrahimafzal
Автор

Hello Abbas i don't know by this moment if you can help me ill really appreciate, i have a problem with the middleware i can't get the user in the session when i console log it i got a null . please help me 🙏

habibmoussa
Автор

Good job, brother! Have u ever tried to get session object with getServerSession() in api route handler function? Because, currently i cant. When I return getServerSession() in my api root, I get null. Do u know the solution for that?

tunaralyarzada
Автор

I get a 401 error when i add a new address

johnloyd
Автор

if i do this
const error = new ErrorHandler("Login first to access this route", 401)
console.log(error)
I get this
ErrorHandler: Login first to access this route
at Array.isAuthenticatedUser
at
at async {
statusCode: 401
}

neveriodev
Автор

Dude, this help me a lot i was stuck with this, thanks!!!!

l
Автор

Quick question: how many parts will there be in this series?

Military
Автор

Hello will you make a travel booking app in your channel like this one with redux it will be great it's a request

jehanzebsiddiqui
Автор

@codingwithabbas please guide on error I have tried everything. Any help will be appreciated!

Hafsa-mk