(url: URL)
| 130 | } |
| 131 | |
| 132 | function loginRedirect(url: URL): Response { |
| 133 | const next = `${url.pathname}${url.search}`; |
| 134 | const target = next === '/' ? '/login' : `/login?next=${encodeURIComponent(next)}`; |
| 135 | return redirect(target); |
| 136 | } |
| 137 | |
| 138 | function nonce(): string { |
| 139 | const bytes = crypto.getRandomValues(new Uint8Array(16)); |