Skip to content

Commit

Permalink
fix: properly redirect back to earlier page after clicking sign in (#87)
Browse files Browse the repository at this point in the history
Fixes #82

### TL;DR

When going to paperless and whishper and clicking sign in on that page, it should go back to that page after signing in
  • Loading branch information
aamirazad authored Jul 9, 2024
1 parent 574c80e commit c3cb33c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio",
"dev": "next dev",
"dev": "next dev --turbo",
"lint": "next lint",
"start": "next start"
},
Expand Down
1 change: 0 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default function HomePage() {
</OpenExternalLink>{" "}
to get started.
</div>
<div>Or sign in to access the dashboard.</div>
</div>
</main>
);
Expand Down
5 changes: 4 additions & 1 deletion src/app/paperless/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ export default function PaperlessPage() {
<div className="flex flex-col items-center justify-center">
<SignedOut>
<div className="text-center text-2xl">
Please <OpenInternalLink href="/sign-in">sign in</OpenInternalLink>
Please{" "}
<OpenInternalLink href="/sign-in?redirect=/paperless">
sign in
</OpenInternalLink>
</div>
</SignedOut>
<SignedIn>
Expand Down
5 changes: 4 additions & 1 deletion src/app/whishper/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ export default function WhishperPage() {
<div className="flex flex-col items-center justify-center">
<SignedOut>
<div className="text-center text-2xl">
Please <OpenInternalLink href="/sign-in">sign in</OpenInternalLink>
Please{" "}
<OpenInternalLink href="/sign-in?redirect=/whishper">
sign in
</OpenInternalLink>
</div>
</SignedOut>
<SignedIn>
Expand Down

0 comments on commit c3cb33c

Please sign in to comment.