Checking if UserId is same with .env doesnt work.
Answered
aliyorulmazdev posted this in #help-forum
const userIdFromEnv = process.env.USER_ID;
const { userId } = useAuth();
if (userId !== userIdFromEnv) {
return <div>You are not authorized for this saloon.</div>;
}this just doesnt work i dont know why. If i write userId directly here without using .env it works but i need to get it from .env file.
1 Reply
NEXT_PUBLIC_USER_ID instead of USER_ID fixed it.
Answer