diff --git a/app/auth/opengraph-image.jpeg b/app/auth/opengraph-image.jpeg new file mode 100644 index 0000000..823880b Binary files /dev/null and b/app/auth/opengraph-image.jpeg differ diff --git a/app/auth/twitter-image.jpeg b/app/auth/twitter-image.jpeg new file mode 100644 index 0000000..823880b Binary files /dev/null and b/app/auth/twitter-image.jpeg differ diff --git a/app/layout.tsx b/app/layout.tsx index ba3f21c..b6f05db 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -22,7 +22,6 @@ export const metadata: Metadata = { description: 'H.A.T.s HIS Attendance Task System (smart absence, task management, work permit and leave mangement, etc).', applicationName: 'HIS Attendance Task System (H.A.T.s)', keywords: ["react", "server components", 'rsc', 'nextjs', 'tailwind', 'typescript', 'shadcn', 'presence', 'absence', 'task', 'admin', 'cms', 'dashboard'], - generator: 'ichsankurnia', authors: [{ name: 'ichsankurnia', url: 'https://ichsankurnia-portfolio.vercel.app' }], creator: 'ichsankurnia', openGraph: { @@ -67,7 +66,7 @@ export default async function RootLayout({ modal: React.ReactNode; }) { // FOR INSECURE SSL (ex: Self Signed Certificates) - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' + // process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' const session = await getServerSession(authOptions) diff --git a/app/opengraph-image.jpeg b/app/opengraph-image.jpeg new file mode 100644 index 0000000..823880b Binary files /dev/null and b/app/opengraph-image.jpeg differ diff --git a/app/opengraph-image.png b/app/opengraph-image.png deleted file mode 100644 index affa88a..0000000 Binary files a/app/opengraph-image.png and /dev/null differ diff --git a/app/twitter-image.jpeg b/app/twitter-image.jpeg new file mode 100644 index 0000000..823880b Binary files /dev/null and b/app/twitter-image.jpeg differ diff --git a/app/twitter-image.png b/app/twitter-image.png deleted file mode 100644 index affa88a..0000000 Binary files a/app/twitter-image.png and /dev/null differ diff --git a/lib/fetchData.ts b/lib/fetchData.ts index 5edb78e..3f3fc94 100644 --- a/lib/fetchData.ts +++ b/lib/fetchData.ts @@ -20,6 +20,7 @@ export default async function fetchData(url: string = '/', cache: "default" | "f // Recommendation: handle errors if (!res.ok) { + console.log("FETCH ERROR DATA :", res.status, data) if (res.status === 401 || res.status === 403) return redirect(`/auth?error=Session error or has expired !`) // This will activate the closest `error.js` Error Boundary throw new Error(`(${data.code || res.status}) ${data.message || res.statusText}`) @@ -55,6 +56,7 @@ export async function fetchDataWithPost(url: string = '/', payload: any = {}, ca } if (!res.ok) { + console.log("FETCH ERROR DATA :", res.status, data) if (res.status === 401 || res.status === 403) redirect(`/auth?error=Session error or has expired !`); throw new Error(`(${data?.code || res.status} ${res.statusText}) ${data?.message}`); diff --git a/next.config.ts b/next.config.ts index fd62934..a080e49 100644 --- a/next.config.ts +++ b/next.config.ts @@ -16,6 +16,8 @@ const nextConfig: NextConfig = { remotePatterns: [ new URL('https://36.66.3.44/**'), new URL('https://his.nutech-integrasi.com/**'), + new URL('https://hats.hisnutech.my.id/**'), + new URL('https://api-hats.hisnutech.my.id/**'), { protocol: 'https', hostname: 'avatars.githubusercontent.com', pathname: '/u/**/*' }, { protocol: 'https', hostname: 'lh3.googleusercontent.com', pathname: '/a/**/*' } ], diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts index 0b91f67..b9c5c4f 100644 --- a/pages/api/auth/[...nextauth].ts +++ b/pages/api/auth/[...nextauth].ts @@ -17,7 +17,7 @@ async function refreshAccessToken(token: any) { // If the access token has expired, try to refresh it try { // FOR INSECURE SSL (ex: Self Signed Certificates) - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' + // process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' // 1. Race Condition Check: // If we refreshed recently (within 10s), return the current token @@ -65,17 +65,6 @@ async function refreshAccessToken(token: any) { export const authOptions: NextAuthOptions = { // FORCE COOKIE SETTINGS (To fix localhost rejection) - cookies: { - sessionToken: { - name: useSecureCookies ? `__Secure-next-auth.session-token` : `next-auth.session-token`, - options: { - httpOnly: true, - sameSite: 'lax', - path: '/', - secure: useSecureCookies, // strictly false on http://localhost - }, - }, - }, providers: [ CredentialsProvider({ name: "Credentials", @@ -85,7 +74,7 @@ export const authOptions: NextAuthOptions = { }, async authorize(credentials, req) { // FOR INSECURE SSL (ex: Self Signed Certificates) - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' + // process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' const { email, password } = credentials as any;