Skip to content

Commit

Permalink
okay, i think I managed to get the local authentication working again…
Browse files Browse the repository at this point in the history
… (in dev server). gonna start trying to see if I can get the actual github actions workflow to do it too.
  • Loading branch information
siddheshraze committed Sep 4, 2024
1 parent d6bc405 commit 1c1982d
Show file tree
Hide file tree
Showing 11 changed files with 492 additions and 1,684 deletions.
28 changes: 1 addition & 27 deletions .github/workflows/main-forestgeo-livesite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
echo AZURE_AD_CLIENT_ID=${{ secrets.AZURE_AD_CLIENT_ID }} >> frontend/.env
echo AZURE_AD_TENANT_ID=${{ secrets.AZURE_AD_TENANT_ID }} >> frontend/.env
echo NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }} >> frontend/.env
echo NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }} >> frontend/.env
echo NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL_DEV }} >> frontend/.env
echo AZURE_SQL_USER=${{ secrets.AZURE_SQL_USER }} >> frontend/.env
echo AZURE_SQL_PASSWORD=${{ secrets.AZURE_SQL_PASSWORD }} >> frontend/.env
echo AZURE_SQL_SERVER=${{ secrets.AZURE_SQL_SERVER }} >> frontend/.env
Expand Down Expand Up @@ -122,32 +122,6 @@ jobs:
echo OWNER=${{ secrets.OWNER }} >> frontend/.env
echo REPO=${{ secrets.REPO }} >> frontend/.env
- name: create env file (in frontend/ directory) -- development
id: create-env-file-dev
if: startsWith(github.ref, 'refs/heads/forestgeo-app-')
run: |
touch frontend/.env
echo AZURE_AD_CLIENT_SECRET=${{ secrets.AZURE_AD_CLIENT_SECRET }} >> frontend/.env
echo AZURE_AD_CLIENT_ID=${{ secrets.AZURE_AD_CLIENT_ID }} >> frontend/.env
echo AZURE_AD_TENANT_ID=${{ secrets.AZURE_AD_TENANT_ID }} >> frontend/.env
echo NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }} >> frontend/.env
echo NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }} >> frontend/.env
echo AZURE_SQL_USER=${{ secrets.AZURE_SQL_USER }} >> frontend/.env
echo AZURE_SQL_PASSWORD=${{ secrets.AZURE_SQL_PASSWORD }} >> frontend/.env
echo AZURE_SQL_SERVER=${{ secrets.AZURE_SQL_SERVER }} >> frontend/.env
echo AZURE_SQL_DATABASE=${{ secrets.AZURE_SQL_DATABASE }} >> frontend/.env
echo AZURE_SQL_PORT=${{ secrets.AZURE_SQL_PORT }} >> frontend/.env
echo AZURE_STORAGE_SAS_CONNECTION_STRING=${{ secrets.AZURE_STORAGE_SAS_CONNECTION_STRING }} >> frontend/.env
echo AZURE_SQL_SCHEMA=${{ secrets.AZURE_SQL_SCHEMA }} >> frontend/.env
echo AZURE_SQL_CATALOG_SCHEMA=${{ secrets.AZURE_SQL_CATALOG_SCHEMA }} >> frontend/.env
echo AZURE_STORAGE_CONNECTION_STRING=${{ secrets.AZURE_STORAGE_CONNECTION_STRING }} >> frontend/.env
echo NEXTAUTH_DEBUG=true >> frontend/.env
echo NODE_ENV=development >> frontend/.env
echo PORT=3000 >> frontend/.env
echo FG_PAT=${{ secrets.FG_PAT }} >> frontend/.env
echo OWNER=${{ secrets.OWNER }} >> frontend/.env
echo REPO=${{ secrets.REPO }} >> frontend/.env
- name: Cache node modules
uses: actions/cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/api/auth/[[...nextauth]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const handler = NextAuth({
AzureADProvider({
clientId: process.env.AZURE_AD_CLIENT_ID!,
clientSecret: process.env.AZURE_AD_CLIENT_SECRET!,
tenantId: process.env.AZURE_AD_CLIENT_ID!,
tenantId: process.env.AZURE_AD_TENANT_ID!,
authorization: { params: { scope: 'openid profile email user.Read' } }
})
],
Expand Down
26 changes: 0 additions & 26 deletions frontend/app/api/hash/census/route.ts

This file was deleted.

28 changes: 0 additions & 28 deletions frontend/app/api/hash/plots/route.ts

This file was deleted.

24 changes: 0 additions & 24 deletions frontend/app/api/hash/quadrats/route.ts

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/config/crypto-actions.ts

This file was deleted.

1 change: 0 additions & 1 deletion frontend/config/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'reflect-metadata';
import { PoolConnection } from 'mysql2/promise';
import { runQuery } from '@/components/processors/processormacros';

Expand Down
4 changes: 2 additions & 2 deletions frontend/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Redirects authenticated users to the dashboard page from the home page.
* Allows the request to continue if no redirect conditions are met.
*/

import { getToken } from 'next-auth/jwt';
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';
import { NextRequest, NextResponse } from 'next/server';

export async function middleware(request: NextRequest) {
const session = await getToken({
Expand Down
2 changes: 0 additions & 2 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ 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 Down
Loading

0 comments on commit 1c1982d

Please sign in to comment.