diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-06 12:26:29 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-06 12:26:29 +0000 |
| commit | 083ea5bd19172381bb53e95aaf98eaabef839c54 (patch) | |
| tree | 4d1c041aab7cd8d15382330db08caeb9c5a12c63 /web/components | |
| parent | b792121977ade8bdd3fb62704b65a9fcbd1436b9 (diff) | |
| download | karakeep-083ea5bd19172381bb53e95aaf98eaabef839c54.tar.zst | |
Move the web app into a subdir
Diffstat (limited to 'web/components')
| -rw-r--r-- | web/components/auth/login.tsx | 17 | ||||
| -rw-r--r-- | web/components/auth/logout.tsx | 12 |
2 files changed, 29 insertions, 0 deletions
diff --git a/web/components/auth/login.tsx b/web/components/auth/login.tsx new file mode 100644 index 00000000..4cd55546 --- /dev/null +++ b/web/components/auth/login.tsx @@ -0,0 +1,17 @@ +"use client"; +import { signIn } from "next-auth/react"; + +export const LoginButton = () => { + return ( + <button + className="btn btn-primary" + onClick={() => + signIn(undefined, { + callbackUrl: "/", + }) + } + > + Sign in + </button> + ); +}; diff --git a/web/components/auth/logout.tsx b/web/components/auth/logout.tsx new file mode 100644 index 00000000..87391c84 --- /dev/null +++ b/web/components/auth/logout.tsx @@ -0,0 +1,12 @@ +"use client"; +import { signOut } from "next-auth/react"; + +export const LogoutButton = () => { + return ( + <button className="btn btn-ghost normal-case" onClick={() => signOut({ + callbackUrl: "/", + })}> + Sign Out + </button> + ); +}; |
