mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-27 09:32:20 -05:00
refactor: remove user prefix from endpoints (#358)
This commit is contained in:
@@ -3,16 +3,11 @@ import {
|
||||
signOut,
|
||||
twoFactorActions,
|
||||
useListPasskeys,
|
||||
userActions,
|
||||
useSession,
|
||||
revokeSession,
|
||||
updateUser,
|
||||
} from "@/libs/auth-client";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "./ui/card";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";
|
||||
import { UAParser } from "ua-parser-js";
|
||||
import { Image, ImageFallback, ImageRoot } from "./ui/image";
|
||||
import type { Session, User } from "better-auth/types";
|
||||
@@ -109,7 +104,7 @@ export function UserCard(props: {
|
||||
<button
|
||||
class="text-red-500 opacity-80 cursor-pointer text-xs border-muted-foreground border-red-600 underline "
|
||||
onClick={async () => {
|
||||
const res = await userActions.revokeSession({
|
||||
const res = await revokeSession({
|
||||
id: activeSession.id,
|
||||
});
|
||||
|
||||
@@ -216,7 +211,7 @@ function EditUserDialog(props: { user?: User }) {
|
||||
<Button
|
||||
onClick={async () => {
|
||||
setIsLoading(true);
|
||||
await userActions.update({
|
||||
await updateUser({
|
||||
image: image()
|
||||
? await convertImageToBase64(image()!)
|
||||
: undefined,
|
||||
|
||||
@@ -8,9 +8,12 @@ export const {
|
||||
signUp,
|
||||
passkey: passkeyActions,
|
||||
useListPasskeys,
|
||||
user: userActions,
|
||||
twoFactor: twoFactorActions,
|
||||
$Infer,
|
||||
updateUser,
|
||||
changePassword,
|
||||
revokeSession,
|
||||
revokeSessions,
|
||||
} = createAuthClient({
|
||||
baseURL:
|
||||
process.env.NODE_ENV === "development"
|
||||
|
||||
Reference in New Issue
Block a user