Hi there, is there any way to check if the user is...
# support-questions-legacy
p
Hi there, is there any way to check if the user is an admin or not? Like a way that we can set a particular user as an admin?
r
Hey! Have you seen the docs for user roles?
You can essentially associate the admin role to a user’s session during session creation. And then fetch that value from the session whenever needed
If you tell me the recipe that you are using, I can point to the right docs
p
Hi, I'm using supertokens React + Node
r
Yes. But which recipe in that? Maybe you want to checkout our guides docs 🙂
p
Sorry, actually it's emailandpassword recipe
I have another question as well, Don't you have a one click deployment to Heroku since this supports self hosting?
r
We don’t have a one click deployment for heroku yet unfortunately.
But please feel free to contribute that in if it’s easy 🙂
p
Okay thanks. I'll come back to you later
r
Cool
p
Hi again, I was able to get the super tokens up and running. Awesome!
r
Great!!
p
One problem, Inthe node side I'm using
Copy code
"type": "module",
Now I need to check if the user is logged or not
Copy code
import {
  middleware,
  errorHandler,
  verifySession,
} from "supertokens-node/framework/express/index.js";
But the problem is when I try to import verify session like this it throws me an import errror
I'm not using typescript either
r
You need to use require syntax with JS
Not import
p
But since I use "type": "module" I can't use require. Isn't there a workaround for this?
r
hmmm. try:
Copy code
import {
  middleware,
  errorHandler,
  verifySession,
} from "supertokens-node/framework/express/index";
i.e., without the
.js
part.