- Firebase is auth provider.
- Not deployed to Render yet - was just testing locally so far. But yes I do use render.
- Yep that’s right. When deployed it’s ran with
yarn api-server --functions ./dist/functions --port 80
. - For local dev - Right now I use
yarn rw dev --fwd=\"--disable-host-check=true\" & CONTEXT=PORTAL_APP yarn rw dev web --fwd=\"--disable-host-check=true --port=7910\" --generate=false
for dev.
This is my requireAuth
export const requireAuth = ({ role } = {}) => {
if (!context.currentUser) {
throw new AuthenticationError("You don't have permission to do that.")
}
if (typeof role !== 'undefined' && typeof role === 'string' && !context.currentUser.roles?.includes(role)) {
throw new ForbiddenError("You don't have access to do that.")
}
if (typeof role !== 'undefined' && Array.isArray(role) && !context.currentUser.roles?.some((r) => role.includes(r))) {
throw new ForbiddenError("You don't have access to do that.")
}
}
- If you log while in
getCurrentUser()
do you see the user info?
Do you mean the token and details like that?