You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each user gets a public profile slug (referenced in Public Profile Accessibility via Credential Scan #69). As such, each user then has a referral link https://eneiconf.pt/r/<slug>. The URL doesn't need to be signed. The signed URL is generated using app/url.ts:
The referral URL page is only accessible to participants and promoters.
Referral links only become available after the user has purchased a ticket.
To enforce this, the ReferralController must check that the user referenced in the slug already has a ticket. The browser/user is only linked to the promoter if that check is successful.
When someone clicks a referral link: ...
If the user is not logged in, the controller creates a cookie valid for 7 days and named referrer on the browser with the id of the referrer. This is made to endure changes in the slug (if the user changes the name, for instance).
Create a middleware, using node ace make:middleware LinkToUserMiddleware.
On the middleware, check if the referrer cookie exists. If it does, use await auth.check() to silently authenticate the user. Then, use if (auth.user) to get the user. Link the user to the referrer that is stored in the cookie.
User Story:
As a participant or promoter, I want to generate a unique referral link so that I can invite others to register for the event.
Acceptance Criteria:
The text was updated successfully, but these errors were encountered: