-
Notifications
You must be signed in to change notification settings - Fork 18
Use user_uid
over user_email
ubiquitously
#3386
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
Use user_uid
over user_email
ubiquitously
#3386
Conversation
tee-worker/omni-executor/rpc-server/src/methods/pumpx/export_wallet.rs
Outdated
Show resolved
Hide resolved
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.
I think we should get the user ID from the BE, for us there is no way to verify it and map it to the user's email. We can keep the email authentication as it is, call the BE to get the user ID for that email and issue the JWTs with the OmniAcccount (sub) derived from that ID
…er-user_email-ubiquitously
); | ||
}; | ||
|
||
if res.user_id != params.user_id { |
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 we query it from backend anyway can we simply not accept it from frontend ?
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.
I think it gives us extra chance to tell F/E something goes wrong early.
If F/E doesn't pass in user_email
- it could still give the wrong/arbitrary user_id
. Now at least they need to pass in matching pairs.
Context
As topic - hopefully we get the same mapped omni-account as backend this way so we don't have to move assets.
For some cases where email verification code needs to be validated, a
user_email
is still needed.In
exportWallet
andwithdraw
it verifies if the user_id and user_email matchIt also provides a helper rpc
pumpx_getOmniAccount
for cross-check