mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-11-09 10:35:42 +00:00
refactor: use controller approach in handlers
This commit is contained in:
@@ -26,7 +26,7 @@ export const LogoutPage = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const logoutMutation = useMutation({
|
||||
mutationFn: () => axios.post("/api/logout"),
|
||||
mutationFn: () => axios.post("/api/user/logout"),
|
||||
mutationKey: ["logout"],
|
||||
onSuccess: () => {
|
||||
toast.success(t("logoutSuccessTitle"), {
|
||||
|
||||
@@ -32,7 +32,7 @@ export const TotpPage = () => {
|
||||
const redirectUri = searchParams.get("redirect_uri");
|
||||
|
||||
const totpMutation = useMutation({
|
||||
mutationFn: (values: TotpSchema) => axios.post("/api/totp", values),
|
||||
mutationFn: (values: TotpSchema) => axios.post("/api/user/totp", values),
|
||||
mutationKey: ["totp"],
|
||||
onSuccess: () => {
|
||||
toast.success(t("totpSuccessTitle"), {
|
||||
|
||||
Reference in New Issue
Block a user