Admin and User Panel Ecommerce Mern App Mern Stack Project

preview_player
Показать описание
Admin and User Panel
Ecommerce Mern App Mern Stack Project
--------------------------------------------------------------------
#mern #mernstack #mernproject
mern stack tutorials in hindi,amazone clone with mern stack,shopping app mern stack tutorial,learn mern stack,mern app,mern stack project,

/*****Support my work*********
every single rupees matter (1Rs-10Rs-100Rs....)
for India : (PAYTM/ GooglePay/Phonepay /Amazon Pay )
* Outside INDIA:(PayPal)
OR

----
#techinfoyt #mernstacktutorials
Рекомендации по теме
Комментарии
Автор

hey guys i found the issue, for the uncaught runtime error when user tries to access the admin page.
in the isAdmin middleware, we are returning 401 code, instead just remove the status code.
export const isAdmin = async (req, res, next) => {
try {
const user = await
if (user.role !== 1) {
return res.send({
success: true,
message: "UnAuthorized Access, only admin can add new products",
});
} else {
next();
}
} catch (error) {
console.log(error);
res.status(401).send({
success: false,
error,
message: "Error in admin middleware",
});
}
};

abhishekkumar-felw
Автор

I follwed your complete video but redirection not happen like 8.28 in your one. It is better if you can add subtitle or do it english. I am from Sri Lanka

Kira-fjel
Автор

Why did you stop using REACT_APP_API from env also i get error when i try to go to admin dashboard from user login

hetvikothai
Автор

sir ya videos pahlay ki record hain ya ap abhi new bna rahay hain. ap ka ya project kafi advance lag raha hai. thank you very much. aur please is ko complete zroor kerya ga . ap bht jaldi jaldi videos upload ker rahay hain is liye ap ko jitna b thanks kahay kam hai. aur please andazay say bataye k kitni videos aur a sakti hain.

World_information
Автор

I don't know why but product category page not conncting to the admin route if i am connect category page with user then its working perfectly and everything working fine

chazoagori
Автор

Thanks buddy chl gya ek glti se mne middleware m mistake krdi thi

getHiredWithMe
Автор

User se login hone k bad bhi dashboard k liye spinner aara h kya problem aari h or yahi same problem admin se bhi aa rahi h

deepakbhawsarr
Автор

Sir in user when we moved to admin it redirect to homepage but also show runtime error 401 which appears on screen for mili seconds because of isAdmin export const isAdmin = async (req, res, next) => {
try {
const user = await
if (user.role !== 1) {
return res.status(401).send({
success: false,
message: "UnAuthorized Access",
});
} else {
next(); how we correct it?

bestu
Автор

i am able to access admin dashboard but when user login and tries to access dashboard page its showing 404 page not found page and there is no error in console

shivankumar
Автор

Bro tell me tumne kha se development sikha ??? Ho skta hai meri strategy galat hai

getHiredWithMe
Автор

If i click dashboard from admin account it is redirecting to user dashboard

vagdeviavanthika
Автор

<Route path="/dashboard" element={<PrivateRoute />}>
<Route path="user" element={<Dashboard />} />
</Route>
<Route path="/dashboard" element={<AdminRoute />}>
<Route path="admin" element={<AdminDashboard />} />
</Route>

bhai ye run time pe evaluate kese hota hai, matlab manine /dashboard url pe searcch kiya to kya ye dono route eveluate honge ?

MilanNakum-gc
Автор

Ye bar bar redirecting to you in 3 sec kyu dikha rha hai ... Mne wha pr to koi functionality add hi ni kri

getHiredWithMe
Автор

"Failed to load resource: the server responded with a status of 401 (Unauthorized)
settle.js:19 Uncaught (in promise) AxiosError" how to solve this? Whenever i am accessing admin dashboard at 5:50 (after user login) getting this error in console.
And in browser it is showing:
"Uncaught runtime errors:
×
ERROR
Request failed with status code 401
AxiosError: Request failed with status code 401"
Help me out..

kajalpunjabi
Автор

Mera dashboard access nhi hora error dikhara sara code sahi he fir bhi pls suggest me any solution

thesaniyaatar
Автор

ok so I wanted password to be in between 6 to 20 characters and phone number of 10 digits, when implemented that, something went wrong

_ayushgoyal
Автор

how do you set role = 1 for admin as we have used default role = 0 in schema

Harshi
Автор

can we define role in admin pannel rather than going to mongo db

tinkugupta
Автор

okay so to solve axos error 404,
you have to go check mongodb users database and set the role as 0 for the id which u are trying to login.
like if solved

priyanshgupta
Автор

no ig i am doing something wrong for role : 1 i am not getting access

priyanshgupta