Skip to content

Commit 1cf0f9c

Browse files
authored
Merge pull request #216 from techulus/main
Fix login redirect
2 parents 5fca12a + eb6db4e commit 1cf0f9c

8 files changed

Lines changed: 79 additions & 74 deletions

File tree

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ Manage is an open-source project management platform. With its intuitive interfa
1212
# See .env.example for all available environment variables
1313
```
1414

15-
### Run using Docker
16-
17-
```bash
18-
docker-compose up
19-
```
20-
2115
## Deployment
2216

2317
<a href="https://railway.com?referralCode=techulus">

app/(auth)/accept-invite/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export default function AcceptInvitePage() {
6767
}
6868

6969
async function handleOtpSuccess() {
70+
router.refresh();
7071
await refetch();
7172
}
7273

app/(auth)/sign-in/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ export default function SignInPage() {
6565
<CardContent>
6666
<OtpVerificationForm
6767
email={email}
68-
onSuccess={() => router.push(redirect)}
68+
onSuccess={async () => {
69+
router.refresh();
70+
router.push(redirect);
71+
}}
6972
onBack={() => setSent(false)}
7073
/>
7174
</CardContent>

app/(dashboard)/[tenant]/today/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "lucide-react";
1212
import Link from "next/link";
1313
import { useParams } from "next/navigation";
14-
import { useQueryState } from "nuqs";
14+
import { parseAsString, useQueryState } from "nuqs";
1515
import { useState } from "react";
1616
import { Greeting } from "@/components/core/greeting";
1717
import { PageLoading } from "@/components/core/loaders";
@@ -35,9 +35,10 @@ export default function Today() {
3535

3636
const trpc = useTRPC();
3737
const queryClient = useQueryClient();
38-
const [statuses] = useQueryState("status", {
39-
defaultValue: "active",
40-
});
38+
const [statuses] = useQueryState(
39+
"status",
40+
parseAsString.withDefault("active"),
41+
);
4142

4243
const [{ data: todayData }, { data: projectsData }, { data: timezone }] =
4344
useQueries({

app/page.tsx

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ export default async function Home() {
1515
return <ClientRedirect path="/start" />;
1616
}
1717

18+
const signupsDisabled = isSignupDisabled();
19+
1820
return (
1921
<div className="min-h-screen">
20-
<Header disableSignups={isSignupDisabled()} />
22+
<Header disableSignups={signupsDisabled} />
2123

2224
<section>
2325
<div className="mx-auto max-w-7xl relative border border-gray-200 dark:border-gray-800 pb-24 pt-8 px-6">
@@ -49,12 +51,14 @@ export default async function Home() {
4951
tech stack and open source values.
5052
</p>
5153
<div className="flex flex-col sm:flex-row gap-4 justify-center items-center">
52-
<Link
53-
href="/start"
54-
className="inline-block bg-green-600 text-white px-6 py-3 rounded-full text-lg font-semibold shadow-sm shadow-green-600/25 border-b-4 border-green-700 hover:bg-green-500 hover:border-green-600 active:border-green-600 active:shadow-sm active:translate-y-0.5 transition-all duration-150 dark:bg-green-600 dark:border-green-700 dark:hover:bg-green-500 dark:hover:border-green-600"
55-
>
56-
Try Manage →
57-
</Link>
54+
{!signupsDisabled && (
55+
<Link
56+
href="/start"
57+
className="inline-block bg-green-600 text-white px-6 py-3 rounded-full text-lg font-semibold shadow-sm shadow-green-600/25 border-b-4 border-green-700 hover:bg-green-500 hover:border-green-600 active:border-green-600 active:shadow-sm active:translate-y-0.5 transition-all duration-150 dark:bg-green-600 dark:border-green-700 dark:hover:bg-green-500 dark:hover:border-green-600"
58+
>
59+
Try Manage →
60+
</Link>
61+
)}
5862
<Link
5963
href="https://github.com/techulus/manage"
6064
className="inline-flex items-center gap-2 px-6 py-3 rounded-full text-lg font-semibold border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 transition-colors"
@@ -447,14 +451,16 @@ export default async function Home() {
447451
?
448452
</h2>
449453

450-
<div className="flex flex-col sm:flex-row gap-4 justify-center items-center">
451-
<Link
452-
href="/start"
453-
className="inline-block bg-green-600 text-white px-6 py-3 rounded-full text-lg font-semibold shadow-sm shadow-green-600/25 border-b-4 border-green-700 hover:bg-green-500 hover:border-green-600 active:border-green-600 active:shadow-sm active:translate-y-0.5 transition-all duration-150 dark:bg-green-600 dark:border-green-700 dark:hover:bg-green-500 dark:hover:border-green-600"
454-
>
455-
Get started →
456-
</Link>
457-
</div>
454+
{!signupsDisabled && (
455+
<div className="flex flex-col sm:flex-row gap-4 justify-center items-center">
456+
<Link
457+
href="/start"
458+
className="inline-block bg-green-600 text-white px-6 py-3 rounded-full text-lg font-semibold shadow-sm shadow-green-600/25 border-b-4 border-green-700 hover:bg-green-500 hover:border-green-600 active:border-green-600 active:shadow-sm active:translate-y-0.5 transition-all duration-150 dark:bg-green-600 dark:border-green-700 dark:hover:bg-green-500 dark:hover:border-green-600"
459+
>
460+
Get started →
461+
</Link>
462+
</div>
463+
)}
458464
</div>
459465
</section>
460466

components/auth/otp-verification-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
interface OtpVerificationFormProps {
1414
email: string;
15-
onSuccess: () => void;
15+
onSuccess: () => void | Promise<void>;
1616
onBack: () => void;
1717
}
1818

@@ -39,7 +39,7 @@ export function OtpVerificationForm({
3939
toast.error(result.error.message || "Invalid verification code");
4040
} else {
4141
toast.success("Signed in successfully");
42-
onSuccess();
42+
await onSuccess();
4343
}
4444
} catch {
4545
toast.error("Failed to verify code. Please try again.");

components/layout/navbar.tsx

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -155,48 +155,52 @@ export function Navbar({ notificationsWire }: { notificationsWire: string }) {
155155

156156
<OrgSwitcher />
157157

158-
<svg
159-
height="16"
160-
strokeLinejoin="round"
161-
viewBox="0 0 16 16"
162-
width="16"
163-
className="hidden md:block text-neutral-300 dark:text-neutral-600 w-5 h-5 mr-1"
164-
>
165-
<path
166-
fillRule="evenodd"
167-
clipRule="evenodd"
168-
d="M4.01526 15.3939L4.3107 14.7046L10.3107 0.704556L10.6061 0.0151978L11.9849 0.606077L11.6894 1.29544L5.68942 15.2954L5.39398 15.9848L4.01526 15.3939Z"
169-
fill="currentColor"
170-
/>
171-
</svg>
172-
173-
<DropdownMenu>
174-
<DropdownMenuTrigger asChild>
175-
<Button
176-
variant="ghost"
177-
className="flex items-center p-1.5"
178-
size="sm"
158+
{projects.length > 0 && (
159+
<>
160+
<svg
161+
height="16"
162+
strokeLinejoin="round"
163+
viewBox="0 0 16 16"
164+
width="16"
165+
className="hidden md:block text-neutral-300 dark:text-neutral-600 w-5 h-5 mr-1"
179166
>
180-
<span className="text-sm text-neutral-500 dark:text-neutral-400">
181-
{activeProject?.name || "Projects"}
182-
</span>
183-
<ChevronDown className="h-4 w-4 text-muted-foreground" />
184-
</Button>
185-
</DropdownMenuTrigger>
186-
<DropdownMenuContent align="start" className="w-56">
187-
{projects.map((project) => (
188-
<DropdownMenuItem
189-
key={project.id}
190-
onClick={() =>
191-
router.push(`/${tenant}/projects/${project.id}`)
192-
}
193-
className="cursor-pointer"
194-
>
195-
<span>{project.name}</span>
196-
</DropdownMenuItem>
197-
))}
198-
</DropdownMenuContent>
199-
</DropdownMenu>
167+
<path
168+
fillRule="evenodd"
169+
clipRule="evenodd"
170+
d="M4.01526 15.3939L4.3107 14.7046L10.3107 0.704556L10.6061 0.0151978L11.9849 0.606077L11.6894 1.29544L5.68942 15.2954L5.39398 15.9848L4.01526 15.3939Z"
171+
fill="currentColor"
172+
/>
173+
</svg>
174+
175+
<DropdownMenu>
176+
<DropdownMenuTrigger asChild>
177+
<Button
178+
variant="ghost"
179+
className="flex items-center p-1.5"
180+
size="sm"
181+
>
182+
<span className="text-sm text-neutral-500 dark:text-neutral-400">
183+
{activeProject?.name || "Projects"}
184+
</span>
185+
<ChevronDown className="h-4 w-4 text-muted-foreground" />
186+
</Button>
187+
</DropdownMenuTrigger>
188+
<DropdownMenuContent align="start" className="w-56">
189+
{projects.map((project) => (
190+
<DropdownMenuItem
191+
key={project.id}
192+
onClick={() =>
193+
router.push(`/${tenant}/projects/${project.id}`)
194+
}
195+
className="cursor-pointer"
196+
>
197+
<span>{project.name}</span>
198+
</DropdownMenuItem>
199+
))}
200+
</DropdownMenuContent>
201+
</DropdownMenu>
202+
</>
203+
)}
200204
</div>
201205

202206
<div className="ml-auto flex items-center space-x-1">

components/settings/team-settings.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,7 @@ export function TeamSettings() {
159159
}
160160

161161
if (!activeOrg) {
162-
return (
163-
<div className="p-4 text-muted-foreground">
164-
Team settings are only available for workspaces.
165-
</div>
166-
);
162+
return null;
167163
}
168164

169165
if (isLoading) {

0 commit comments

Comments
 (0)