-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Handle missing Discord email sooner. Make sure emails are verified. #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I left just one question out of curiosity
'User needs an email to make a payment. If using the usernameAndPassword Auth method, switch to an Auth method that provides an email.' | ||
); | ||
// If using the usernameAndPassword Auth method, switch to an Auth method that provides an email. | ||
throw new HttpError(403, 'User needs an email to make a payment.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double check: you removed the details because this is a user-facing error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it didn't feel correct to give developer instructions in a user-facing error.
- isAdmin: (data) => { | ||
- const emailData = emailDataSchema.parse(data); | ||
- return adminEmails.includes(emailData.email); | ||
- }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come the example app removes this isAdmin
check.
I can see it also does this in the old version of the code, but why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the example app everyone is an admin so they can test out the admin panel :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you visit https://opensaas.sh/admin you'll notice you can see it with any account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I had a feeling it has something to do with that.
But does that mean that the default behavior is that "if "adminicity" isn't defined, everyone is an admin?"
you'll notice you can see it with any account.
For this feature, I'd expect isAdmin
to be a function that just returns true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is set to true
in the Prisma schema in the opensaas.sh
. Should we create an issue to change that? I think this is fine, it's a demo app we maintain.
This PR:
email
isAdmin
field