diff --git a/backend/src/routes/invitations.js b/backend/src/routes/invitations.js
index 26be3a4..1a1b940 100644
--- a/backend/src/routes/invitations.js
+++ b/backend/src/routes/invitations.js
@@ -23,6 +23,56 @@ function authMiddleware(req, res, next) {
}
}
+/**
+ * PUBLIC: Get invitation info without auth
+ * GET /api/invitations/info/:code
+ * Used to show role info before accepting
+ */
+router.get('/info/:code', async (req, res) => {
+ try {
+ const code = req.params.code;
+
+ if (!code) {
+ return res.status(400).json({ error: 'Code is required' });
+ }
+
+ // Find invitation by code
+ const formattedCode = code.toUpperCase().replace(/-/g, '').replace(/(.{3})/g, '$1-').slice(0, 11);
+
+ let { data: invitation } = await supabase
+ .from('invitations')
+ .select('role, accepted_at')
+ .eq('token', formattedCode)
+ .single();
+
+ // Try without formatting
+ if (!invitation) {
+ const { data: inv2 } = await supabase
+ .from('invitations')
+ .select('role, accepted_at')
+ .eq('token', code.toUpperCase())
+ .single();
+ invitation = inv2;
+ }
+
+ if (!invitation) {
+ return res.status(404).json({ error: 'Invitation not found' });
+ }
+
+ if (invitation.accepted_at) {
+ return res.status(400).json({ error: 'This invitation has already been accepted' });
+ }
+
+ res.json({
+ role: invitation.role
+ });
+
+ } catch (error) {
+ console.error('[INVITE] Get info error:', error);
+ res.status(500).json({ error: error.message });
+ }
+});
+
/**
* PUBLIC: Accept invitation without auth
* POST /api/invitations/accept-public
diff --git a/web/accept-invite.html b/web/accept-invite.html
index ad1ff2e..faddbfc 100644
--- a/web/accept-invite.html
+++ b/web/accept-invite.html
@@ -153,8 +153,24 @@
+
+
+
Loading invitation...
+
+
-
+
+
+
+
+ You've been invited to monitor a family member through WellNuo.
+
+
+
+
With this role you will be able to:
+
+
+
You're all set!
-
-
- You have been granted access to monitor a family member through WellNuo.
+ Your invitation has been accepted. Download the WellNuo app to get started.