···79 <h1>lost the trail</h1>
80 <p>no worries. reload to get back on track</p>
81 <button onClick={() => window.location.reload()}>reload</button>
82- <p>if this didn't help, try logging out and back in (sorry!)</p>
83 </div>
84 </body>
85 </html>
···79 <h1>lost the trail</h1>
80 <p>no worries. reload to get back on track</p>
81 <button onClick={() => window.location.reload()}>reload</button>
082 </div>
83 </body>
84 </html>
+9-13
auth/useAuthAction.ts
···3import { useLoginModal } from "@/app/LoginModalContext";
4import { useAuthContext } from "@/app/AuthContext";
56-export class AuthRequiredError extends Error {
7- constructor() {
8- super("Authentication required");
9- this.name = "AuthRequiredError";
10- }
11-}
12-13export function useAuthAction() {
14 const { openLoginModal } = useLoginModal();
15 const { did } = useAuthContext();
1617- return () => {
18- if (!did) {
19- openLoginModal();
20- throw new AuthRequiredError();
21- }
22- };
00023}