Skip to content
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

✨ User Enrollment Interface #43

Closed
shnizzedy opened this issue Nov 18, 2019 · 5 comments
Closed

✨ User Enrollment Interface #43

shnizzedy opened this issue Nov 18, 2019 · 5 comments

Comments

@shnizzedy
Copy link
Member

Given an invitation body (example:

You have been invited by Jon (<a href="mailto:jon.clucas@childmind.org">jon.clucas@childmind.org</a>) to <b>Healthy Brain Network (1)</b> on
MindLogger on localhost (jclucas-rsch).
<br/>
<h2>Description</h2><p>Daily questions about your child's physical and mental health</p>
<h3>The following users can see your data for this applet</h3><ul><li>Jon &lt;jon.clucas@childmind.org&gt;</li></ul>
<h3>The following users can change settings for this applet, including who can access your data</h3><ul><li>Jon &lt;jon.clucas@childmind.org&gt;</li></ul>
<h3>The following users can change settings for this applet, but not who can access your data</h3><ul><li>Jon &lt;jon.clucas@childmind.org&gt;</li></ul>
<br/>
To accept, click https://b1c4baaf.ngrok.io/api/v1/invitation/5dd307eaeb96c4d9cb343ffd/accept.

)

  1. Check if user is logged in
  2. If not, let user register or log in
  3. Let the user accept or decline the invitation
@shnizzedy shnizzedy added enhancement New feature or request user-reported labels Nov 18, 2019
@shnizzedy shnizzedy added this to Needs triage in ✨ New Feature Triage via automation Nov 18, 2019
@shnizzedy shnizzedy added this to To do in MindLogger: EMAs for HBN and NIMH via automation Nov 18, 2019
@shnizzedy
Copy link
Member Author

Routes:

GET /invitation/{id}: get invitation HTML with link or message to log in first.
GET /invitation/{id}/accept: accept an invitation by token.
POST /invitation/{id}/accept: accept an invitation.
GET /invitation/{id}/qr: get a link to an invitation by QR code.
DELETE /invitation/{id}/remove: decline an invitation.

@shnizzedy
Copy link
Member Author

I think what we'd want here is either something in the web app or in a standalone interface that takes an invitation ID and holds onto it until a user registers or logs in and then accepts or declines.

@shnizzedy
Copy link
Member Author

If we use the web app, at least ChildMindInstitute/mindlogger-web#51 and ChildMindInstitute/mindlogger-web#50 would probably need to be resolve before we'd want to send users there.

@shnizzedy shnizzedy moved this from Needs triage to High priority in ✨ New Feature Triage Nov 18, 2019
@shnizzedy
Copy link
Member Author

@henryrossiter here's the invitation flow through the API:

invitation-flow

Create an invitation

  1. Get the ID of an applet (GET /user/applets?role=manager&ids_only=true)
  2. Create an invitation for that applet (POST /applet/{id}/invite).

View an invitation

  1. Step 2 above returns an invitation document, including its _id. GET /applet/{id}/users includes open invitations under the pending key in its response.
  2. Get the invitation document (GET /invitation/{id}). This document is dynamic, based on whether a user is logged in and who that user is.

Accept by token

The link at the bottom of an invitation for a logged-in user calls GET /invitation/{id}/accept with a token that links the logged-in user to that invitation.

Accept by invitation ID

POST /invitation/{id}/accept lets a user accept an invitation by invitation ID rather than a token

Decline an invitation

DELETE /invitation/{id}/remove just deletes an invitation.


5dd41af00213ece5a06e1cad is an example invitation to 5dcdd8419882ef2902b63e53 that I created on dev.

@shnizzedy
Copy link
Member Author

ChildMindInstitute/mindlogger-backend#226 adds ID code functionality to these calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user-reported
Projects
No open projects
Development

No branches or pull requests

1 participant