mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 02:01:33 +10:00
github auth
This commit is contained in:
@ -2,6 +2,7 @@ import { Fragment } from "react";
|
||||
import { Disclosure, Menu, Transition } from "@headlessui/react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { signOut } from "next-auth/react";
|
||||
|
||||
import {
|
||||
Bars3Icon,
|
||||
@ -24,7 +25,14 @@ const navigation = [
|
||||
];
|
||||
const userNavigation = [
|
||||
{ name: "Your Profile", href: "/settings" },
|
||||
{ name: "Sign out", href: "/login" },
|
||||
{
|
||||
name: "Sign out",
|
||||
href: "/login",
|
||||
click: (e: any) => {
|
||||
e.preventDefault();
|
||||
signOut();
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
function classNames(...classes: any) {
|
||||
@ -127,6 +135,7 @@ export default function Layout({ children }: any) {
|
||||
{({ active }) => (
|
||||
<Link
|
||||
href={item.href}
|
||||
onClick={item.click}
|
||||
className={classNames(
|
||||
active ? "bg-gray-100" : "",
|
||||
"block px-4 py-2 text-sm text-gray-700"
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { LockClosedIcon } from "@heroicons/react/20/solid";
|
||||
import Link from "next/link";
|
||||
import Logo from "./logo";
|
||||
import { signIn } from "next-auth/react";
|
||||
|
||||
export default function Example() {
|
||||
return (
|
||||
@ -76,17 +77,21 @@ export default function Example() {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Link href="/dashboard">
|
||||
<button className="group relative flex w-full justify-center rounded-md border border-transparent bg-neon py-2 px-4 text-sm font-medium text-white hover:bg-neon-dark focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
<span className="absolute inset-y-0 left-0 flex items-center pl-3">
|
||||
<LockClosedIcon
|
||||
className="h-5 w-5 text-neon-dark group-hover:text-neon"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</span>
|
||||
Sign in
|
||||
</button>
|
||||
</Link>
|
||||
<button
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
signIn();
|
||||
}}
|
||||
className="group relative flex w-full justify-center rounded-md border border-transparent bg-neon py-2 px-4 text-sm font-medium text-white hover:bg-neon-dark focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
||||
>
|
||||
<span className="absolute inset-y-0 left-0 flex items-center pl-3">
|
||||
<LockClosedIcon
|
||||
className="h-5 w-5 text-neon-dark group-hover:text-neon"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</span>
|
||||
Sign in
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user