Skip to content

Commit

Permalink
fix: went back to proper
Browse files Browse the repository at this point in the history
  • Loading branch information
Wamy-Dev committed Aug 12, 2023
1 parent dae558f commit 8c9de01
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions apps/web/src/lib/components/layout/NavBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { Button } from 'ui/button';
import { Dropdown } from 'ui/dropdown';
import { BarsThree } from 'ui/icons';
import { PUBLIC_GITHUB_CALL_URL } from '$env/static/public';
import { env } from '$env/dynamic/public';
import { isAuthenticated, user } from '$lib/stores/user';
import { onMount } from 'svelte';
import jwt_decode from 'jwt-decode';
Expand Down Expand Up @@ -50,7 +50,10 @@
<img alt="user icon" src={$user.user.avatar} draggable="false" class="flex flex-shrink-0 w-8 h-8 min-w-[32px] min-h-[32px] md:w-10 md:h-10 rounded-full">
</Link>
{:else}
<Link variant="secondary" href={env.PUBLIC_GITHUB_CALL_URL}>
<!-- <Link variant="secondary" href={apiURL}>
Login
</Link> -->
<a href={env.PUBLIC_GITHUB_CALL_URL} class="flex items-center gap-2">
Login
</a>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/routes/callback/github/+page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PUBLIC_API_URL } from '$env/static/public';
import { env } from '$env/dynamic/public';
import type { PageLoad } from './$types';
import { redirect } from '@sveltejs/kit';
import { jwtKey } from '$lib/stores/user';
Expand All @@ -9,7 +9,7 @@ export const load = (async ({ url: { searchParams }, fetch }) => {
throw redirect(302, '/');
} else {
try {
const response = await fetch(`${PUBLIC_API_URL}/auth/github?code=${code}`, {
const response = await fetch(`${env.PUBLIC_API_URL}/auth/github?code=${code}`, {
method: 'POST',
headers: {
"Access-Control-Allow-Origin": "*",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/routes/mod/[mod]/+page.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { PageLoad } from './$types';
import { PUBLIC_API_URL } from '$env/static/public';
import { env } from '$env/dynamic/public';

export const load = (async ({ params, fetch }) => {
const slug = params.mod;
try {
const response = await fetch(`${PUBLIC_API_URL}/graphql`, {
const response = await fetch(`${env.PUBLIC_API_URL}/graphql`, {
method: 'POST',
headers: {
'content-type': 'application/json'
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/routes/profile/[id]/+page.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { PageLoad } from './$types';
import { PUBLIC_API_URL } from '$env/static/public';
import { env } from '$env/dynamic/public';

export const load = (async ({ params, fetch }) => {
const id = params.id;
try {
const response = await fetch(`${PUBLIC_API_URL}/graphql`, {
const response = await fetch(`${env.PUBLIC_API_URL}/graphql`, {
method: 'POST',
headers: {
'content-type': 'application/json'
Expand Down

0 comments on commit 8c9de01

Please sign in to comment.