mirror of
https://github.com/better-auth/better-auth.git
synced 2026-06-02 04:16:38 -05:00
@@ -26,14 +26,23 @@ export function ThemeToggle() {
|
||||
<span className="sr-only">Toggle theme</span>
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem onClick={() => setTheme("light")}>
|
||||
<DropdownMenuContent className="rounded-none" align="end">
|
||||
<DropdownMenuItem
|
||||
className="rounded-none"
|
||||
onClick={() => setTheme("light")}
|
||||
>
|
||||
Light
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setTheme("dark")}>
|
||||
<DropdownMenuItem
|
||||
className="rounded-none"
|
||||
onClick={() => setTheme("dark")}
|
||||
>
|
||||
Dark
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setTheme("system")}>
|
||||
<DropdownMenuItem
|
||||
className="rounded-none"
|
||||
onClick={() => setTheme("system")}
|
||||
>
|
||||
System
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
|
||||
@@ -17,7 +17,7 @@ Single Sign-On (SSO) allows users to authenticate with multiple applications usi
|
||||
<Step>
|
||||
### Add Plugin to the server
|
||||
|
||||
```ts title="auth.ts"
|
||||
```ts title="auth.ts"
|
||||
import { betterAuth } from "better-auth"
|
||||
import { sso } from "better-auth/plugins/sso";
|
||||
|
||||
@@ -49,11 +49,11 @@ Single Sign-On (SSO) allows users to authenticate with multiple applications usi
|
||||
</Step>
|
||||
<Step>
|
||||
### Add the client plugin
|
||||
|
||||
|
||||
```ts title="auth-client.ts"
|
||||
import { createAuthClient } from "better-auth/client"
|
||||
import { ssoClient } from "better-auth/client/plugins"
|
||||
|
||||
|
||||
const authClient = createAuthClient({
|
||||
plugins: [ // [!code highlight]
|
||||
ssoClient() // [!code highlight]
|
||||
@@ -145,6 +145,7 @@ const res = await authClient.signIn.sso({
|
||||
|
||||
or you can specify the domain:
|
||||
|
||||
|
||||
```
|
||||
const res = await authClient.signIn.sso({
|
||||
domain: "example.com",
|
||||
|
||||
Reference in New Issue
Block a user