-
Notifications
You must be signed in to change notification settings - Fork 1
User Ingress
User ingress into SeaSketch has to consider user authentication with auth0 as well as project and survey invites which are represented as json web tokens.
Users follow links from project invite emails to a specific landing page on SeaSketch for handling. In order for the flow to proceed, the invite needs the following information encoded:
{
/** So the server can verify the token still exists */
inviteId: number,
/** May be useful for debugging or customizing the user experience */
isAdmin: boolean,
groups: number[],
/** May be useful for customizing signup forms */
fullname?: string,
email: string,
}
Tokens should have a reasonable expiration, say 60 days.
While the client can independently verify the jwt token's validity, the client can't verify that the invitation hasn't been deleted/revoked by the admin, or whether it has already been used. Instead the client should call isValidProjectInvite(token)
.
Checking whether a user is authorized to view a project is simply a matter of looking for errors when requesting currentProject
.
Survey invites differ from project invites in that they can be included in requests to the GraphQL API in the x-survey-invite
header to gain access to content without logging in.
Similar to project invites, the landing page should check with the server for cases of revocation or multiple use in single-response surveys. The client can call verifySurveyInvite(token)
for this task. Survey tokens should contain the following claims:
{
inviteId: number,
surveyId: number,
projectInviteToken?: jwt,
/** For customizing contact forms */
fullname?: string,
email: string
}