feat: enhance Stripstream configuration handling
- Introduced a new resolver function to streamline fetching Stripstream configuration from the database or environment variables. - Updated various components and API routes to utilize the new configuration resolver, improving code maintainability and reducing direct database calls. - Added optional environment variables for Stripstream URL and token in the .env.example file. - Refactored image loading logic in the reader components to improve performance and error handling.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { signIn } from "next-auth/react";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
@@ -16,7 +15,6 @@ interface LoginFormProps {
|
||||
}
|
||||
|
||||
export function LoginForm({ from }: LoginFormProps) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<AppErrorType | null>(null);
|
||||
const { t } = useTranslate();
|
||||
@@ -57,8 +55,7 @@ export function LoginForm({ from }: LoginFormProps) {
|
||||
}
|
||||
|
||||
const redirectPath = getSafeRedirectPath(from);
|
||||
window.location.assign(redirectPath);
|
||||
router.refresh();
|
||||
window.location.href = redirectPath;
|
||||
} catch {
|
||||
setError({
|
||||
code: "AUTH_FETCH_ERROR",
|
||||
|
||||
Reference in New Issue
Block a user