mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:46:29 +00:00
update opengraph
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
+1
-2
@@ -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)
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 553 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 553 KiB |
@@ -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}`);
|
||||
|
||||
@@ -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/**/*' }
|
||||
],
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user