feat(pitch-deck): redirect to pitch if valid session on magic link re-click
Some checks failed
Build pitch-deck / build-push-deploy (push) Successful in 1m25s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 48s
CI / test-bqas (push) Has been cancelled
CI / test-python-voice (push) Has started running
Some checks failed
Build pitch-deck / build-push-deploy (push) Successful in 1m25s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 48s
CI / test-bqas (push) Has been cancelled
CI / test-python-voice (push) Has started running
If an investor clicks the magic link again after already being logged in, check /api/auth/me first — valid session → redirect to / immediately instead of showing the 'link already used' error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,13 @@ function VerifyContent() {
|
||||
|
||||
async function verify() {
|
||||
try {
|
||||
// If the investor already has a valid session, skip token verification
|
||||
const sessionCheck = await fetch('/api/auth/me')
|
||||
if (sessionCheck.ok) {
|
||||
router.push('/')
|
||||
return
|
||||
}
|
||||
|
||||
const res = await fetch('/api/auth/verify', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
||||
Reference in New Issue
Block a user