Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
fix(web): fix auth on local mode
Browse files Browse the repository at this point in the history
  • Loading branch information
f1shy-dev committed May 22, 2021
1 parent 6be22d8 commit 481b72a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/web/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { getServer } from './lib/getServer';
config({ path: join(__dirname, '../../.env') });

// default to running api locally
const apiMode = (process.env.API_MODE ??= 'local');
console.log(apiMode);
const apiMode = process.env.API_MODE ?? 'local';

if (apiMode == 'local') config({ path: join(__dirname, '../../../api/.env') });

Expand Down
4 changes: 3 additions & 1 deletion packages/web/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export const apiMode = process.env.API_MODE ?? 'local';

export const baseURL =
process.env.DEV_MODE === 'local'
apiMode === 'local'
? process.env.NEXT_PUBLIC_BASE_URL
: 'https://dev.oasis.sh';

Expand Down
1 change: 1 addition & 0 deletions packages/web/src/lib/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const Login = (type: string): any => {
switch (type) {
// GitHub Authentication
case 'github':
alert([type, window.location.href, baseURL]);
return (window.location.href = `${baseURL}/api/auth/github`);

// Twitter Authentication
Expand Down
4 changes: 2 additions & 2 deletions packages/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"@styles/*": ["src/styles"],
"@utils/*": ["src/utils/*"]
},
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"target": "es6",
"lib": ["DOM", "DOM.Iterable", "ESNext", "ES2020"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand Down

0 comments on commit 481b72a

Please sign in to comment.