Skip to content

Commit

Permalink
login errors -- nextauth is unable to find secret for some reason??
Browse files Browse the repository at this point in the history
  • Loading branch information
siddheshraze committed Sep 3, 2024
1 parent c2ea0cf commit cab2160
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
6 changes: 3 additions & 3 deletions frontend/app/api/auth/[[...nextauth]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const handler = NextAuth({
secret: process.env.NEXTAUTH_SECRET as string,
providers: [
AzureADProvider({
clientId: process.env.AZURE_AD_CLIENT_ID!,
clientSecret: process.env.AZURE_AD_CLIENT_SECRET!,
tenantId: process.env.AZURE_AD_TENANT_ID!,
clientId: process.env.AZURE_AD_DEVELOPMENT_CLIENT_ID!,
clientSecret: process.env.AZURE_AD_DEVELOPMENT_CLIENT_SECRET!,
tenantId: process.env.AZURE_AD_DEVELOPMENT_TENANT_ID!,
authorization: { params: { scope: 'openid profile email user.Read' } }
})
],
Expand Down
3 changes: 3 additions & 0 deletions frontend/app/api/fetchall/[[...slugs]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const buildQuery = (schema: string, fetchType: string, plotID?: string, plotCens
${schema}.quadrats q ON p.PlotID = q.PlotID
GROUP BY p.PlotID
${plotID && plotID !== 'undefined' && !isNaN(parseInt(plotID)) ? `HAVING p.PlotID = ${plotID}` : ''}`;
} else if (fetchType === 'roles') {
return `SELECT *
FROM ${schema}.${fetchType}`;
} else {
let query = `SELECT *
FROM ${schema}.${fetchType}`;
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/processors/processpersonnel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function processPersonnel(props: Readonly<SpecialProcessingProps>)
'roles',
{
RoleName: normalizedRole,
RoleDescription: rowData.roledescription
RoleDescription: rowData.roledescription ?? null
},
'RoleID'
);
Expand Down
3 changes: 2 additions & 1 deletion frontend/components/validationcard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const ValidationCard: React.FC<ValidationCardProps> = ({ validation, onSaveChang
transform: isFlipped ? 'rotateY(180deg)' : 'rotateY(0)',
transition: 'transform 0.6s',
perspective: 1000,
minHeight: 'inherit'
minHeight: 'inherit',
overflow: 'auto'
}}
>
<Stack direction="row" justifyContent="space-between" alignItems="flex-start">
Expand Down
7 changes: 6 additions & 1 deletion frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const nextConfig = withBundleAnalyzer({
unoptimized: true // since images are served from public directory
},
env: {
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
AZURE_SQL_USER: process.env.AZURE_SQL_USER,
AZURE_SQL_PASSWORD: process.env.AZURE_SQL_PASSWORD,
AZURE_SQL_SERVER: process.env.AZURE_SQL_SERVER,
Expand All @@ -30,7 +32,10 @@ const nextConfig = withBundleAnalyzer({
AZURE_SQL_CATALOG_SCHEMA: process.env.AZURE_SQL_CATALOG_SCHEMA,
FG_PAT: process.env.FG_PAT,
OWNER: process.env.OWNER,
REPO: process.env.REPO
REPO: process.env.REPO,
AZURE_AD_CLIENT_SECRET: process.env.NODE_ENV === 'production' ? process.env.AZURE_AD_CLIENT_SECRET : process.env.AZURE_AD_DEVELOPMENT_CLIENT_SECRET,
AZURE_AD_CLIENT_ID: process.env.NODE_ENV === 'production' ? process.env.AZURE_AD_CLIENT_ID : process.env.AZURE_AD_DEVELOPMENT_CLIENT_ID,
AZURE_AD_TENANT_ID: process.env.NODE_ENV === 'production' ? process.env.AZURE_AD_TENANT_ID : process.env.AZURE_AD_DEVELOPMENT_TENANT_ID,
}
});

Expand Down

0 comments on commit cab2160

Please sign in to comment.