Search...
user
Returns the details of the current site user who is logged in.
Description
Returns an object with the id
and role
of the logged in user
who made the router request.
Type:
WixRouterUserRead Only
Was this helpful?
Get the user from the router request
Copy Code
1export function myRouter_Router(request) {2 let user = request.user;3 let userId = user.id; // "f6q0fb32-b06r-469f-ag4d-9df89afkj5d9"4 let role = user.role; // "Admin"5}