mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-12 15:41:53 +02:00
🐛 Fix login error (#932)
This commit is contained in:
parent
3f6a5603b3
commit
e3aacbe668
8 changed files with 141 additions and 176 deletions
|
@ -22,7 +22,6 @@ import {
|
|||
UserPlusIcon,
|
||||
} from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { signOut } from "next-auth/react";
|
||||
|
||||
import { LoginLink } from "@/components/login-link";
|
||||
import { RegisterLink } from "@/components/register-link";
|
||||
|
@ -147,25 +146,25 @@ export const UserDropdown = () => {
|
|||
<Trans i18nKey="createAnAccount" defaults="Register" />
|
||||
</RegisterLink>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem
|
||||
className="flex items-center gap-x-2"
|
||||
onSelect={() =>
|
||||
signOut({
|
||||
redirect: false,
|
||||
})
|
||||
}
|
||||
asChild
|
||||
className="flex text-destructive items-center gap-x-2"
|
||||
>
|
||||
<RefreshCcwIcon className="h-4 w-4" />
|
||||
<Trans i18nKey="forgetMe" />
|
||||
{/* Don't use signOut() from next-auth. It doesn't work in vercel-production env. I don't know why. */}
|
||||
<a href="/logout">
|
||||
<RefreshCcwIcon className="h-4 w-4" />
|
||||
<Trans i18nKey="forgetMe" />
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
</IfGuest>
|
||||
<IfAuthenticated>
|
||||
<DropdownMenuItem
|
||||
className="flex items-center gap-x-2"
|
||||
onSelect={() => signOut()}
|
||||
>
|
||||
<LogOutIcon className="h-4 w-4" />
|
||||
<Trans i18nKey="logout" />
|
||||
<DropdownMenuItem asChild className="flex items-center gap-x-2">
|
||||
{/* Don't use signOut() from next-auth. It doesn't work in vercel-production env. I don't know why. */}
|
||||
<a href="/logout">
|
||||
<LogOutIcon className="h-4 w-4" />
|
||||
<Trans i18nKey="logout" />
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
</IfAuthenticated>
|
||||
</DropdownMenuContent>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue