Hi, I try to build a confirmation dialog for new invited users. After they click the invitation link in the e-mail, I would like to show a confirmation box with this :
{inviterName} invited you to {teamName}. Do you accept?
But the Teams API do not allow me to fetch the pending membership for obvious security reasons. Is there a way to achieve this by using another API?
Else, I can bypass this step, as the email do the same, but on a UX perspective, I think it could be good to have this confirmation inside the app.
Thank you.
Summary
The user is asking if there is a way to prevent a user from automatically logging in once an invitation is accepted. They also ask about the passwordUpdate attribute for a user without a password. The response suggests using an Appwrite Function to handle these cases. The user also asks if the inviter's name is available in the pending invitation database table. The response suggests using "Someone invited you to {teamName}" as the email message. There is no solution provided for fetching pending memberships or showing a confirmation box within the app.
Richard Trudel
Rank 1: Thread
Mar 17, 2023, 15:23
I guess the inviter name is not available either. I can also use Someone invited you to {teamName}. But as the email can show the inviter's name, I guess it's living somewhere in a pending invitation database table?
Richard Trudel
Rank 1: Thread
Mar 17, 2023, 15:54
Also, new users after accepting invitation are automatically logged in, without being prompted to set a new password. I guess I can work around it by redirecting the user to the set password process, but if we could retrieve the invitation, I guess we would receive also if the user is already existing or not, so I could prompt for new password along the invitation acceptance...
Not sure it's all clear, but I can clarify if required of course.
Drake
Admin
Mar 17, 2023, 17:46
The only way would be to use an Appwrite Function.
What's the passwordUpdate attribute on the result of account.get() for a user without a password? 🧐
Richard Trudel
Rank 1: Thread
Mar 17, 2023, 18:01
Thank you, I was trying to avoid functions for that particuliar case, but it may be simple after all 🙂
Richard Trudel
Rank 1: Thread
Mar 17, 2023, 18:02
I understand for the email, that means the inviter's name (or reference to it) is not stored anywhre so I can't rely on it.
Richard Trudel
Rank 1: Thread
Mar 17, 2023, 18:04
Of course I can wait after the invitation is accepted to redirect to the set password form, or I can make my same function of above to query the userId to know if it's a user without a password and show the set password form along the invitation acceptance, I guess...
Richard Trudel
Rank 1: Thread
Mar 17, 2023, 18:06
But, another question in the same topic which can helps to find the best flow for my specific case, there is a way to prevent a user from being automatically logged in once an invitation is accepted?
Drake
Admin
Mar 17, 2023, 18:28
not really because that's how the API works
Drake
Admin
Mar 17, 2023, 18:29
and if you don't, they wouldn't be able to do anything 🧐