@striae-org/striae 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/.env.example +100 -0
  2. package/LICENSE +190 -0
  3. package/NOTICE +18 -0
  4. package/README.md +133 -0
  5. package/app/components/actions/case-export/core-export.ts +328 -0
  6. package/app/components/actions/case-export/data-processing.ts +167 -0
  7. package/app/components/actions/case-export/download-handlers.ts +900 -0
  8. package/app/components/actions/case-export/index.ts +41 -0
  9. package/app/components/actions/case-export/metadata-helpers.ts +107 -0
  10. package/app/components/actions/case-export/types-constants.ts +56 -0
  11. package/app/components/actions/case-export/validation-utils.ts +25 -0
  12. package/app/components/actions/case-export.ts +4 -0
  13. package/app/components/actions/case-import/annotation-import.ts +35 -0
  14. package/app/components/actions/case-import/confirmation-import.ts +363 -0
  15. package/app/components/actions/case-import/image-operations.ts +61 -0
  16. package/app/components/actions/case-import/index.ts +39 -0
  17. package/app/components/actions/case-import/orchestrator.ts +420 -0
  18. package/app/components/actions/case-import/storage-operations.ts +270 -0
  19. package/app/components/actions/case-import/validation.ts +189 -0
  20. package/app/components/actions/case-import/zip-processing.ts +413 -0
  21. package/app/components/actions/case-manage.ts +524 -0
  22. package/app/components/actions/case-review.ts +4 -0
  23. package/app/components/actions/confirm-export.ts +351 -0
  24. package/app/components/actions/generate-pdf.ts +210 -0
  25. package/app/components/actions/image-manage.ts +385 -0
  26. package/app/components/actions/notes-manage.ts +33 -0
  27. package/app/components/actions/signout.module.css +15 -0
  28. package/app/components/actions/signout.tsx +50 -0
  29. package/app/components/audit/user-audit-viewer.tsx +975 -0
  30. package/app/components/audit/user-audit.module.css +568 -0
  31. package/app/components/auth/auth-provider.tsx +78 -0
  32. package/app/components/auth/mfa-enrollment.module.css +268 -0
  33. package/app/components/auth/mfa-enrollment.tsx +398 -0
  34. package/app/components/auth/mfa-verification.module.css +251 -0
  35. package/app/components/auth/mfa-verification.tsx +295 -0
  36. package/app/components/button/button.module.css +63 -0
  37. package/app/components/button/button.tsx +46 -0
  38. package/app/components/canvas/box-annotations/box-annotations.module.css +170 -0
  39. package/app/components/canvas/box-annotations/box-annotations.tsx +634 -0
  40. package/app/components/canvas/canvas.module.css +314 -0
  41. package/app/components/canvas/canvas.tsx +449 -0
  42. package/app/components/canvas/confirmation/confirmation.module.css +187 -0
  43. package/app/components/canvas/confirmation/confirmation.tsx +214 -0
  44. package/app/components/colors/colors.module.css +59 -0
  45. package/app/components/colors/colors.tsx +68 -0
  46. package/app/components/form/base-form.tsx +21 -0
  47. package/app/components/form/form-button.tsx +28 -0
  48. package/app/components/form/form-field.tsx +53 -0
  49. package/app/components/form/form-message.tsx +17 -0
  50. package/app/components/form/form-toggle.tsx +23 -0
  51. package/app/components/form/form.module.css +427 -0
  52. package/app/components/form/index.ts +6 -0
  53. package/app/components/icon/icon.module.css +3 -0
  54. package/app/components/icon/icon.tsx +27 -0
  55. package/app/components/icon/icons.svg +102 -0
  56. package/app/components/icon/manifest.json +110 -0
  57. package/app/components/sidebar/case-export/case-export.module.css +386 -0
  58. package/app/components/sidebar/case-export/case-export.tsx +317 -0
  59. package/app/components/sidebar/case-import/case-import.module.css +626 -0
  60. package/app/components/sidebar/case-import/case-import.tsx +404 -0
  61. package/app/components/sidebar/case-import/components/CasePreviewSection.tsx +72 -0
  62. package/app/components/sidebar/case-import/components/ConfirmationDialog.tsx +72 -0
  63. package/app/components/sidebar/case-import/components/ConfirmationPreviewSection.tsx +71 -0
  64. package/app/components/sidebar/case-import/components/ExistingCaseSection.tsx +40 -0
  65. package/app/components/sidebar/case-import/components/FileSelector.tsx +161 -0
  66. package/app/components/sidebar/case-import/components/ProgressSection.tsx +46 -0
  67. package/app/components/sidebar/case-import/hooks/useFilePreview.ts +101 -0
  68. package/app/components/sidebar/case-import/hooks/useImportExecution.ts +152 -0
  69. package/app/components/sidebar/case-import/hooks/useImportState.ts +88 -0
  70. package/app/components/sidebar/case-import/index.ts +18 -0
  71. package/app/components/sidebar/case-import/utils/file-validation.ts +43 -0
  72. package/app/components/sidebar/cases/case-sidebar.tsx +827 -0
  73. package/app/components/sidebar/cases/cases-modal.module.css +166 -0
  74. package/app/components/sidebar/cases/cases-modal.tsx +201 -0
  75. package/app/components/sidebar/cases/cases.module.css +713 -0
  76. package/app/components/sidebar/files/files-modal.module.css +209 -0
  77. package/app/components/sidebar/files/files-modal.tsx +239 -0
  78. package/app/components/sidebar/hash/hash-utility.module.css +366 -0
  79. package/app/components/sidebar/hash/hash-utility.tsx +982 -0
  80. package/app/components/sidebar/notes/notes-modal.tsx +51 -0
  81. package/app/components/sidebar/notes/notes-sidebar.tsx +491 -0
  82. package/app/components/sidebar/notes/notes.module.css +360 -0
  83. package/app/components/sidebar/sidebar-container.tsx +149 -0
  84. package/app/components/sidebar/sidebar.module.css +321 -0
  85. package/app/components/sidebar/sidebar.tsx +215 -0
  86. package/app/components/sidebar/upload/image-upload-zone.module.css +123 -0
  87. package/app/components/sidebar/upload/image-upload-zone.tsx +330 -0
  88. package/app/components/theme-provider/theme-provider.tsx +131 -0
  89. package/app/components/theme-provider/theme.ts +155 -0
  90. package/app/components/toast/toast.module.css +137 -0
  91. package/app/components/toast/toast.tsx +56 -0
  92. package/app/components/toolbar/toolbar-color-selector.module.css +171 -0
  93. package/app/components/toolbar/toolbar-color-selector.tsx +129 -0
  94. package/app/components/toolbar/toolbar.module.css +42 -0
  95. package/app/components/toolbar/toolbar.tsx +167 -0
  96. package/app/components/user/delete-account.module.css +274 -0
  97. package/app/components/user/delete-account.tsx +471 -0
  98. package/app/components/user/inactivity-warning.module.css +145 -0
  99. package/app/components/user/inactivity-warning.tsx +84 -0
  100. package/app/components/user/manage-profile.module.css +190 -0
  101. package/app/components/user/manage-profile.tsx +253 -0
  102. package/app/components/user/mfa-phone-update.tsx +739 -0
  103. package/app/config-example/admin-service.json +13 -0
  104. package/app/config-example/config.json +17 -0
  105. package/app/config-example/firebase.ts +21 -0
  106. package/app/config-example/inactivity.ts +13 -0
  107. package/app/config-example/meta-config.json +6 -0
  108. package/app/contexts/auth.context.ts +12 -0
  109. package/app/entry.client.tsx +12 -0
  110. package/app/entry.server.tsx +44 -0
  111. package/app/hooks/useInactivityTimeout.ts +110 -0
  112. package/app/root.tsx +170 -0
  113. package/app/routes/_index.tsx +16 -0
  114. package/app/routes/auth/emailActionHandler.module.css +232 -0
  115. package/app/routes/auth/emailActionHandler.tsx +405 -0
  116. package/app/routes/auth/emailVerification.tsx +120 -0
  117. package/app/routes/auth/login.module.css +523 -0
  118. package/app/routes/auth/login.tsx +654 -0
  119. package/app/routes/auth/passwordReset.module.css +274 -0
  120. package/app/routes/auth/passwordReset.tsx +154 -0
  121. package/app/routes/auth/route.ts +16 -0
  122. package/app/routes/mobile-prevented/mobilePrevented.module.css +47 -0
  123. package/app/routes/mobile-prevented/mobilePrevented.tsx +26 -0
  124. package/app/routes/mobile-prevented/route.ts +14 -0
  125. package/app/routes/striae/striae.module.css +30 -0
  126. package/app/routes/striae/striae.tsx +417 -0
  127. package/app/services/audit-export.service.ts +755 -0
  128. package/app/services/audit.service.ts +1454 -0
  129. package/app/services/firebase-errors.ts +106 -0
  130. package/app/services/firebase.ts +15 -0
  131. package/app/styles/legal-pages.module.css +113 -0
  132. package/app/styles/root.module.css +146 -0
  133. package/app/tailwind.css +225 -0
  134. package/app/types/annotations.ts +45 -0
  135. package/app/types/audit.ts +301 -0
  136. package/app/types/case.ts +90 -0
  137. package/app/types/export.ts +8 -0
  138. package/app/types/file.ts +30 -0
  139. package/app/types/import.ts +107 -0
  140. package/app/types/index.ts +24 -0
  141. package/app/types/user.ts +38 -0
  142. package/app/utils/SHA256.ts +461 -0
  143. package/app/utils/annotation-timestamp.ts +25 -0
  144. package/app/utils/audit-export-signature.ts +117 -0
  145. package/app/utils/auth-action-settings.ts +48 -0
  146. package/app/utils/auth.ts +34 -0
  147. package/app/utils/batch-operations.ts +135 -0
  148. package/app/utils/confirmation-signature.ts +193 -0
  149. package/app/utils/data-operations.ts +871 -0
  150. package/app/utils/device-detection.ts +5 -0
  151. package/app/utils/html-sanitizer.ts +80 -0
  152. package/app/utils/id-generator.ts +36 -0
  153. package/app/utils/meta.ts +48 -0
  154. package/app/utils/mfa-phone.ts +97 -0
  155. package/app/utils/mfa.ts +79 -0
  156. package/app/utils/password-policy.ts +28 -0
  157. package/app/utils/permissions.ts +562 -0
  158. package/app/utils/signature-utils.ts +160 -0
  159. package/app/utils/style.ts +83 -0
  160. package/app/utils/version.ts +5 -0
  161. package/firebase.json +11 -0
  162. package/functions/[[path]].ts +10 -0
  163. package/package.json +138 -0
  164. package/postcss.config.js +6 -0
  165. package/public/.well-known/publickey.info@striae.org.asc +17 -0
  166. package/public/.well-known/security.txt +7 -0
  167. package/public/_headers +28 -0
  168. package/public/_routes.json +13 -0
  169. package/public/assets/striae.jpg +0 -0
  170. package/public/clear.jpg +0 -0
  171. package/public/favicon.ico +0 -0
  172. package/public/favicon.svg +9 -0
  173. package/public/icon-256.png +0 -0
  174. package/public/icon-512.png +0 -0
  175. package/public/logo-dark.png +0 -0
  176. package/public/manifest.json +25 -0
  177. package/public/oin-badge.png +0 -0
  178. package/public/shortcut.png +0 -0
  179. package/public/social-image.png +0 -0
  180. package/public/striae-ascii.txt +10 -0
  181. package/scripts/deploy-all.sh +100 -0
  182. package/scripts/deploy-config.sh +940 -0
  183. package/scripts/deploy-pages.sh +34 -0
  184. package/scripts/deploy-worker-secrets.sh +215 -0
  185. package/scripts/dev.cjs +23 -0
  186. package/scripts/install-workers.sh +88 -0
  187. package/scripts/run-eslint.cjs +35 -0
  188. package/scripts/update-compatibility-dates.cjs +124 -0
  189. package/scripts/update-markdown-versions.cjs +43 -0
  190. package/tailwind.config.ts +22 -0
  191. package/tsconfig.json +33 -0
  192. package/vite.config.ts +35 -0
  193. package/worker-configuration.d.ts +7490 -0
  194. package/workers/audit-worker/package.json +17 -0
  195. package/workers/audit-worker/src/audit-worker.example.ts +195 -0
  196. package/workers/audit-worker/worker-configuration.d.ts +7448 -0
  197. package/workers/audit-worker/wrangler.jsonc.example +29 -0
  198. package/workers/data-worker/package.json +17 -0
  199. package/workers/data-worker/src/data-worker.example.ts +267 -0
  200. package/workers/data-worker/src/signature-utils.ts +79 -0
  201. package/workers/data-worker/src/signing-payload-utils.ts +290 -0
  202. package/workers/data-worker/worker-configuration.d.ts +7448 -0
  203. package/workers/data-worker/wrangler.jsonc.example +30 -0
  204. package/workers/image-worker/package.json +17 -0
  205. package/workers/image-worker/src/image-worker.example.ts +180 -0
  206. package/workers/image-worker/worker-configuration.d.ts +7447 -0
  207. package/workers/image-worker/wrangler.jsonc.example +22 -0
  208. package/workers/keys-worker/package.json +17 -0
  209. package/workers/keys-worker/src/keys.example.ts +66 -0
  210. package/workers/keys-worker/src/keys.ts +66 -0
  211. package/workers/keys-worker/worker-configuration.d.ts +7447 -0
  212. package/workers/keys-worker/wrangler.jsonc.example +22 -0
  213. package/workers/pdf-worker/package.json +17 -0
  214. package/workers/pdf-worker/src/format-striae.ts +534 -0
  215. package/workers/pdf-worker/src/pdf-worker.example.ts +119 -0
  216. package/workers/pdf-worker/src/report-types.ts +69 -0
  217. package/workers/pdf-worker/worker-configuration.d.ts +7448 -0
  218. package/workers/pdf-worker/wrangler.jsonc.example +26 -0
  219. package/workers/user-worker/package.json +17 -0
  220. package/workers/user-worker/src/user-worker.example.ts +636 -0
  221. package/workers/user-worker/worker-configuration.d.ts +7448 -0
  222. package/workers/user-worker/wrangler.jsonc.example +29 -0
  223. package/wrangler.toml.example +8 -0
@@ -0,0 +1,274 @@
1
+ .container {
2
+ position: relative;
3
+ display: flex;
4
+ justify-content: center;
5
+ align-items: center;
6
+ min-height: 100vh;
7
+ padding: var(--spaceL);
8
+ z-index: var(--zIndex0);
9
+ }
10
+
11
+ .formWrapper {
12
+ background-color: color-mix(in lab, var(--backgroundLight) 95%, transparent);
13
+ padding: var(--space2XL);
14
+ border-radius: var(--spaceXS);
15
+ box-shadow: 0 var(--spaceXS) var(--spaceM) color-mix(in lab, var(--black) 10%, transparent);
16
+ width: 100%;
17
+ max-width: var(--maxWidthS);
18
+ }
19
+
20
+ .form {
21
+ display: flex;
22
+ flex-direction: column;
23
+ gap: var(--spaceM);
24
+ }
25
+
26
+ .logo {
27
+ position: fixed;
28
+ top: var(--spaceL);
29
+ left: var(--spaceL);
30
+ width: 150px;
31
+ height: 150px;
32
+ background-image: url('/logo-dark.png');
33
+ background-size: contain;
34
+ background-repeat: no-repeat;
35
+ background-position: center;
36
+ z-index: var(--zIndex2);
37
+ transition: transform var(--durationM) var(--bezierFastoutSlowin);
38
+ }
39
+
40
+ .logo:hover {
41
+ transform: scale(1.05);
42
+ }
43
+
44
+ .title {
45
+ text-align: center;
46
+ color: var(--textTitle);
47
+ margin-bottom: var(--spaceXL);
48
+ font-size: var(--fontSizeH4);
49
+ }
50
+
51
+ .modalTitle {
52
+ font-size: var(--fontSizeH4);
53
+ font-weight: var(--fontWeightMedium);
54
+ color: var(--textTitle);
55
+ margin: 0 0 var(--spaceXL) 0;
56
+ text-align: center;
57
+ }
58
+
59
+ .input {
60
+ width: 100%;
61
+ padding: var(--spaceL);
62
+ border: 1.5px solid color-mix(in lab, var(--text) 20%, transparent);
63
+ border-radius: var(--spaceXS);
64
+ font-size: var(--fontSizeBodyM);
65
+ transition: all var(--durationS) var(--bezierFastoutSlowin);
66
+ box-sizing: border-box;
67
+ }
68
+
69
+ .input:focus {
70
+ outline: none;
71
+ border-color: var(--primary);
72
+ box-shadow: 0 0 0 2px color-mix(in lab, var(--primary) 25%, transparent);
73
+ }
74
+
75
+ .button {
76
+ width: 100%;
77
+ padding: var(--spaceL);
78
+ background-color: var(--primary);
79
+ color: var(--white);
80
+ border: none;
81
+ border-radius: var(--spaceXS);
82
+ font-weight: var(--fontWeightMedium);
83
+ font-size: var(--fontSizeBodyM);
84
+ cursor: pointer;
85
+ transition: all var(--durationS) var(--bezierFastoutSlowin);
86
+ box-sizing: border-box;
87
+ }
88
+
89
+ .button:hover:not(:disabled) {
90
+ background-color: color-mix(in lab, var(--primary) 85%, var(--black));
91
+ }
92
+
93
+ .secondaryButton {
94
+ width: 100%;
95
+ padding: var(--spaceL);
96
+ background-color: transparent;
97
+ border: 1.5px solid var(--primary);
98
+ color: var(--primary);
99
+ border-radius: var(--spaceXS);
100
+ font-weight: var(--fontWeightMedium);
101
+ font-size: var(--fontSizeBodyM);
102
+ cursor: pointer;
103
+ transition: all var(--durationS) var(--bezierFastoutSlowin);
104
+ box-sizing: border-box;
105
+ }
106
+
107
+ .secondaryButton:hover {
108
+ background-color: color-mix(in lab, var(--primary) 10%, transparent);
109
+ }
110
+
111
+ .error {
112
+ color: color-mix(in lab, var(--error) 90%, var(--black));
113
+ text-align: left;
114
+ margin: var(--spaceXS) 0 var(--spaceS) 0;
115
+ font-size: var(--fontSizeBodyXS);
116
+ padding: var(--spaceS) var(--spaceM);
117
+ background: linear-gradient(135deg,
118
+ color-mix(in lab, var(--error) 12%, transparent),
119
+ color-mix(in lab, var(--error) 8%, transparent)
120
+ );
121
+ border-radius: var(--spaceXS);
122
+ border: 1px solid color-mix(in lab, var(--error) 30%, transparent);
123
+ border-left: 3px solid var(--error);
124
+ animation: slideInError var(--durationS) var(--bezierFastoutSlowin);
125
+ position: relative;
126
+ overflow: hidden;
127
+ box-shadow: 0 2px 8px color-mix(in lab, var(--text) 8%, transparent);
128
+ }
129
+
130
+ .error::before {
131
+ content: '';
132
+ position: absolute;
133
+ top: 0;
134
+ left: 0;
135
+ bottom: 0;
136
+ width: 3px;
137
+ background: var(--error);
138
+ animation: errorPulse 1.5s ease-in-out infinite;
139
+ }
140
+
141
+ .success {
142
+ color: color-mix(in lab, var(--success) 90%, var(--black));
143
+ text-align: left;
144
+ margin: var(--spaceXS) 0 var(--spaceS) 0;
145
+ font-size: var(--fontSizeBodyXS);
146
+ padding: var(--spaceS) var(--spaceM);
147
+ background: linear-gradient(135deg,
148
+ color-mix(in lab, var(--success) 12%, transparent),
149
+ color-mix(in lab, var(--success) 8%, transparent)
150
+ );
151
+ border-radius: var(--spaceXS);
152
+ border: 1px solid color-mix(in lab, var(--success) 30%, transparent);
153
+ border-left: 3px solid var(--success);
154
+ animation: slideInSuccess var(--durationS) var(--bezierFastoutSlowin);
155
+ position: relative;
156
+ overflow: hidden;
157
+ box-shadow: 0 2px 8px color-mix(in lab, var(--text) 8%, transparent);
158
+ }
159
+
160
+ .success::before {
161
+ content: '';
162
+ position: absolute;
163
+ top: 0;
164
+ left: 0;
165
+ bottom: 0;
166
+ width: 3px;
167
+ background: var(--success);
168
+ animation: successPulse 1.5s ease-in-out infinite;
169
+ }
170
+
171
+ .modalOverlay {
172
+ position: fixed;
173
+ inset: 0;
174
+ background-color: color-mix(in lab, var(--background) 50%, transparent);
175
+ display: flex;
176
+ justify-content: center;
177
+ align-items: center;
178
+ z-index: var(--zIndex5);
179
+ }
180
+
181
+ .modal {
182
+ background: var(--backgroundLight);
183
+ border-radius: var(--spaceXS);
184
+ width: 90%;
185
+ max-width: 500px;
186
+ box-shadow: 0 var(--spaceXS) var(--spaceL) color-mix(in lab, var(--black) 10%, transparent);
187
+ overflow: hidden;
188
+ padding: var(--space2XL);
189
+ }
190
+
191
+ .modalHeader {
192
+ display: flex;
193
+ justify-content: space-between;
194
+ align-items: center;
195
+ padding: var(--spaceL);
196
+ font-size: var(--fontSizeH5);
197
+ border-bottom: 1px solid color-mix(in lab, var(--text) 10%, transparent);
198
+ }
199
+
200
+ /* Animations */
201
+ @keyframes slideInError {
202
+ from {
203
+ opacity: 0;
204
+ transform: translateY(calc(-1 * var(--spaceM))) scaleY(0.8);
205
+ max-height: 0;
206
+ padding-top: 0;
207
+ padding-bottom: 0;
208
+ margin-top: 0;
209
+ margin-bottom: 0;
210
+ }
211
+ to {
212
+ opacity: 1;
213
+ transform: translateY(0) scaleY(1);
214
+ max-height: 200px;
215
+ padding-top: var(--spaceS);
216
+ padding-bottom: var(--spaceS);
217
+ margin-top: var(--spaceXS);
218
+ margin-bottom: var(--spaceS);
219
+ }
220
+ }
221
+
222
+ @keyframes errorPulse {
223
+ 0%, 100% {
224
+ opacity: 1;
225
+ box-shadow: 0 0 0 0 color-mix(in lab, var(--error) 40%, transparent);
226
+ }
227
+ 50% {
228
+ opacity: 0.7;
229
+ box-shadow: 0 0 0 4px color-mix(in lab, var(--error) 20%, transparent);
230
+ }
231
+ }
232
+
233
+ @keyframes slideInSuccess {
234
+ from {
235
+ opacity: 0;
236
+ transform: translateY(calc(-1 * var(--spaceM))) scaleY(0.8);
237
+ max-height: 0;
238
+ padding-top: 0;
239
+ padding-bottom: 0;
240
+ margin-top: 0;
241
+ margin-bottom: 0;
242
+ }
243
+ to {
244
+ opacity: 1;
245
+ transform: translateY(0) scaleY(1);
246
+ max-height: 200px;
247
+ padding-top: var(--spaceS);
248
+ padding-bottom: var(--spaceS);
249
+ margin-top: var(--spaceXS);
250
+ margin-bottom: var(--spaceS);
251
+ }
252
+ }
253
+
254
+ @keyframes successPulse {
255
+ 0%, 100% {
256
+ opacity: 1;
257
+ box-shadow: 0 0 0 0 color-mix(in lab, var(--success) 40%, transparent);
258
+ }
259
+ 50% {
260
+ opacity: 0.7;
261
+ box-shadow: 0 0 0 4px color-mix(in lab, var(--success) 20%, transparent);
262
+ }
263
+ }
264
+
265
+ /* Reduce motion for accessibility */
266
+ @media (prefers-reduced-motion: reduce) {
267
+ .error, .success {
268
+ animation: none;
269
+ }
270
+
271
+ .error::before, .success::before {
272
+ animation: none;
273
+ }
274
+ }
@@ -0,0 +1,154 @@
1
+ import { useRef, useState } from 'react';
2
+ import { Link } from '@remix-run/react';
3
+ import { sendPasswordResetEmail, signOut } from 'firebase/auth';
4
+ import { auth } from '~/services/firebase';
5
+ import { handleAuthError, ERROR_MESSAGES } from '~/services/firebase-errors';
6
+ import { auditService } from '~/services/audit.service';
7
+ import { buildActionCodeSettings } from '~/utils/auth-action-settings';
8
+ import styles from './passwordReset.module.css';
9
+
10
+ interface PasswordResetProps {
11
+ isModal?: boolean;
12
+ onBack: () => void;
13
+ }
14
+
15
+ export const PasswordReset = ({ isModal, onBack }: PasswordResetProps) => {
16
+ const formRef = useRef<HTMLFormElement>(null);
17
+ const [error, setError] = useState<string>('');
18
+ const [success, setSuccess] = useState<string>('');
19
+ const [isLoading, setIsLoading] = useState<boolean>(false);
20
+
21
+ const handleReset = async (e: React.FormEvent) => {
22
+ e.preventDefault();
23
+ const email = formRef.current?.email.value;
24
+ if (!email) return;
25
+
26
+ setIsLoading(true);
27
+ setError('');
28
+ setSuccess('');
29
+
30
+ try {
31
+ await sendPasswordResetEmail(auth, email, buildActionCodeSettings());
32
+
33
+ // Sign out immediately after issuing the reset email to reduce session risk.
34
+ try {
35
+ await signOut(auth);
36
+ } catch (signOutError) {
37
+ console.error('Automatic sign-out after password reset request failed:', signOutError);
38
+ setError('Password reset email sent, but automatic sign-out failed. Please sign out manually.');
39
+ return;
40
+ }
41
+
42
+ // Log successful password reset request
43
+ try {
44
+ await auditService.logPasswordReset(
45
+ email,
46
+ 'email',
47
+ 'success'
48
+ );
49
+ } catch (auditError) {
50
+ console.error('Failed to log successful password reset request audit:', auditError);
51
+ }
52
+
53
+ setSuccess(`${ERROR_MESSAGES.RESET_EMAIL_SENT} You have been signed out.`);
54
+ setTimeout(onBack, 2000);
55
+ } catch (err) {
56
+ const { message } = handleAuthError(err);
57
+
58
+ // Log failed password reset attempt
59
+ try {
60
+ await auditService.logPasswordReset(
61
+ email,
62
+ 'email',
63
+ 'failure',
64
+ undefined, // no reset token on failure
65
+ 'email-link',
66
+ 1, // first attempt
67
+ undefined, // password complexity not relevant here
68
+ undefined, // previous password reuse not relevant here
69
+ undefined, // no session ID
70
+ [message] // error details
71
+ );
72
+ } catch (auditError) {
73
+ console.error('Failed to log failed password reset request audit:', auditError);
74
+ }
75
+
76
+ setError(message);
77
+ } finally {
78
+ setIsLoading(false);
79
+ }
80
+ };
81
+
82
+ const FormContent = (
83
+ <form ref={formRef} onSubmit={handleReset} className={styles.form}>
84
+ <input
85
+ type="email"
86
+ name="email"
87
+ placeholder="Email"
88
+ autoComplete="email"
89
+ className={styles.input}
90
+ required
91
+ />
92
+ {error && <p className={styles.error}>{error}</p>}
93
+ {success && <p className={styles.success}>{success}</p>}
94
+ <button type="submit" className={styles.button} disabled={isLoading}>
95
+ {isLoading ? 'Sending...' : 'Send Reset Link'}
96
+ </button>
97
+ <button
98
+ type="button"
99
+ onClick={onBack}
100
+ className={styles.secondaryButton}
101
+ >
102
+ Back
103
+ </button>
104
+ </form>
105
+ );
106
+
107
+ if (isModal) {
108
+ return (
109
+ <div className={styles.modalOverlay}>
110
+ <div className={styles.modal}>
111
+ <h2 className={styles.modalTitle}>Reset Password</h2>
112
+ {FormContent}
113
+ </div>
114
+ </div>
115
+ );
116
+ }
117
+
118
+ return (
119
+ <div className={styles.container}>
120
+ <Link
121
+ viewTransition
122
+ prefetch="intent"
123
+ to="https://striae.org"
124
+ >
125
+ <div className={styles.logo} />
126
+ </Link>
127
+ <div className={styles.formWrapper}>
128
+ <h1 className={styles.title}>Reset Password</h1>
129
+ <form ref={formRef} onSubmit={handleReset} className={styles.form}>
130
+ <input
131
+ type="email"
132
+ name="email"
133
+ placeholder="Email"
134
+ autoComplete="email"
135
+ className={styles.input}
136
+ required
137
+ />
138
+ {error && <p className={styles.error}>{error}</p>}
139
+ {success && <p className={styles.success}>{success}</p>}
140
+ <button type="submit" className={styles.button} disabled={isLoading}>
141
+ {isLoading ? 'Sending...' : 'Send Reset Link'}
142
+ </button>
143
+ <button
144
+ type="button"
145
+ onClick={onBack}
146
+ className={styles.secondaryButton}
147
+ >
148
+ Back
149
+ </button>
150
+ </form>
151
+ </div>
152
+ </div>
153
+ );
154
+ };
@@ -0,0 +1,16 @@
1
+ import { redirect, type LoaderFunctionArgs } from '@remix-run/cloudflare';
2
+ import { isMobileOrTabletUserAgent } from '~/utils/device-detection';
3
+
4
+ export const loader = async ({ request }: LoaderFunctionArgs) => {
5
+ const requestUrl = new URL(request.url);
6
+ const search = requestUrl.search ?? '';
7
+ const userAgent = request.headers.get('user-agent') ?? '';
8
+
9
+ if (isMobileOrTabletUserAgent(userAgent)) {
10
+ throw redirect(`/mobile-prevented${search}`);
11
+ }
12
+
13
+ throw redirect(`/${search}`);
14
+ };
15
+
16
+ export { Login as default, meta } from './login';
@@ -0,0 +1,47 @@
1
+ .container {
2
+ min-height: 100vh;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ padding: var(--spaceL);
7
+ }
8
+
9
+ .card {
10
+ width: 100%;
11
+ max-width: var(--maxWidthS);
12
+ background-color: color-mix(in lab, var(--backgroundLight) 95%, transparent);
13
+ border-radius: var(--spaceXS);
14
+ padding: var(--space2XL);
15
+ box-shadow: 0 var(--spaceXS) var(--spaceM) color-mix(in lab, var(--black) 10%, transparent);
16
+ text-align: center;
17
+ }
18
+
19
+ .title {
20
+ margin: 0 0 var(--spaceM);
21
+ color: var(--textTitle);
22
+ font-size: var(--fontSizeH4);
23
+ }
24
+
25
+ .description {
26
+ margin: 0 0 var(--spaceXL);
27
+ color: var(--textBody);
28
+ font-size: var(--fontSizeBodyM);
29
+ line-height: 1.6;
30
+ }
31
+
32
+ .link {
33
+ display: inline-flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ text-decoration: none;
37
+ background-color: var(--primary);
38
+ color: var(--white);
39
+ border-radius: var(--spaceXS);
40
+ padding: var(--spaceM) var(--spaceL);
41
+ font-size: var(--fontSizeBodyS);
42
+ transition: background-color var(--durationS) var(--bezierFastoutSlowin);
43
+ }
44
+
45
+ .link:hover {
46
+ background-color: color-mix(in lab, var(--primary) 85%, var(--black));
47
+ }
@@ -0,0 +1,26 @@
1
+ import { Link } from '@remix-run/react';
2
+ import { baseMeta } from '~/utils/meta';
3
+ import styles from './mobilePrevented.module.css';
4
+
5
+ export const meta = () => {
6
+ return baseMeta({
7
+ title: 'Desktop Required',
8
+ description: 'Striae authentication is available on desktop devices only.',
9
+ });
10
+ };
11
+
12
+ export const MobilePrevented = () => {
13
+ return (
14
+ <div className={styles.container}>
15
+ <div className={styles.card}>
16
+ <h1 className={styles.title}>Desktop Required</h1>
17
+ <p className={styles.description}>
18
+ Striae authentication is restricted to desktop devices. Please open this page on a desktop or laptop computer to continue.
19
+ </p>
20
+ <Link viewTransition prefetch="intent" to="https://striae.org" className={styles.link}>
21
+ Return Home
22
+ </Link>
23
+ </div>
24
+ </div>
25
+ );
26
+ };
@@ -0,0 +1,14 @@
1
+ import { redirect, type LoaderFunctionArgs } from '@remix-run/cloudflare';
2
+ import { isMobileOrTabletUserAgent } from '~/utils/device-detection';
3
+
4
+ export const loader = async ({ request }: LoaderFunctionArgs) => {
5
+ const userAgent = request.headers.get('user-agent') ?? '';
6
+
7
+ if (!isMobileOrTabletUserAgent(userAgent)) {
8
+ throw redirect('/');
9
+ }
10
+
11
+ return null;
12
+ };
13
+
14
+ export { MobilePrevented as default, meta } from './mobilePrevented';
@@ -0,0 +1,30 @@
1
+ .appContainer {
2
+ display: flex;
3
+ width: 100vw;
4
+ height: 100vh;
5
+ overflow: hidden;
6
+ position: fixed;
7
+ top: 0;
8
+ left: 0;
9
+ z-index: 10;
10
+ }
11
+
12
+ .mainContent {
13
+ flex: 1;
14
+ display: flex;
15
+ flex-direction: column;
16
+ min-width: 0;
17
+ height: 100%;
18
+ }
19
+
20
+ .canvasArea {
21
+ position: relative;
22
+ flex: 1;
23
+ }
24
+
25
+ .toolbarWrapper {
26
+ position: absolute;
27
+ top: var(--spaceL);
28
+ left: var(--spaceL);
29
+ z-index: 30;
30
+ }