Skip to content

Commit

Permalink
fix: request password reset (#156)
Browse files Browse the repository at this point in the history
* ok

* test

* fix start frontend

* fix start frontend
  • Loading branch information
hughcrt authored Mar 29, 2024
1 parent 0decb4d commit 6f4a6b6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ jobs:

- name: Start frontend
env:
APP_URL: http://localhost:8080
API_URL: http://localhost:3333
NEXT_PUBLIC_API_URL: xyzPLACEHOLDERxyz
NEXT_PUBLIC_API_URL: http://localhost:3333
timeout-minutes: 2
run: (npm run build:frontend && npm run start:frontend) & npx wait-on http://localhost:8080/

Expand Down
2 changes: 1 addition & 1 deletion ops
Submodule ops updated from 00491d to e23435
2 changes: 1 addition & 1 deletion packages/frontend/components/layout/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function Navbar() {
setSendingEmail(true)

const ok = await errorHandler(
fetch(`${process.env.API_URL}/v1/users/send-verification`, {
fetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/users/send-verification`, {
method: "POST",
body: JSON.stringify({
email: user?.email,
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const nextConfig = {
],
},
async rewrites() {
if(!process.env.API_URL) {
if(!process.env.NEXT_PUBLIC_API_URL) {
return []
}

Expand All @@ -33,15 +33,15 @@ const nextConfig = {
},
{
source: "/api/v1/report",
destination: process.env.API_URL + "/api/report",
destination: process.env.NEXT_PUBLIC_API_URL + "/api/report",
},
{
source: "/api/report",
destination: process.env.API_URL + "/api/report",
destination: process.env.NEXT_PUBLIC_API_URL + "/api/report",
},
{
source: "/api/v1/template",
destination: process.env.API_URL + "/api/v1/template",
destination: process.env.NEXT_PUBLIC_API_URL + "/api/v1/template",
},
]
},
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/pages/request-password-reset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function PasswordReset() {
setLoading(true)

const res = await errorHandler(
fetch(`${process.env.API_URL}/auth/request-password-reset`, {
fetch(`${process.env.NEXT_PUBLIC_API_URL}/auth/request-password-reset`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/pages/team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ function SAMLConfig() {
<Table.Td>Assertion Consumer Service (ACS) URL:</Table.Td>
<Table.Td>
<CopyInput
value={`${process.env.API_URL}/auth/saml/${org?.id}/acs`}
value={`${process.env.NEXT_PUBLIC_API_URL}/auth/saml/${org?.id}/acs`}
/>
</Table.Td>
</Table.Tr>
<Table.Tr>
<Table.Td>Single Logout Service (SLO) URL:</Table.Td>
<Table.Td>
<CopyInput
value={`${process.env.API_URL}/auth/saml/${org?.id}/slo`}
value={`${process.env.NEXT_PUBLIC_API_URL}/auth/saml/${org?.id}/slo`}
/>
</Table.Td>
</Table.Tr>
Expand All @@ -173,7 +173,7 @@ function SAMLConfig() {
<Table.Td>Single Logout URL:</Table.Td>
<Table.Td>
<CopyInput
value={`${process.env.API_URL}/auth/saml/${org?.id}/slo`}
value={`${process.env.NEXT_PUBLIC_API_URL}/auth/saml/${org?.id}/slo`}
/>
</Table.Td>
</Table.Tr>
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/utils/fetcher/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import Router from "next/router"
import { signOut } from "../auth"
import { showErrorNotification } from "../errors"

const BASE_URL =
(process.env.API_URL as string) || process.env.NEXT_PUBLIC_API_URL
const BASE_URL = process.env.NEXT_PUBLIC_API_URL as string

export function buildUrl(path: string) {
if (path.includes("/auth")) {
Expand Down

0 comments on commit 6f4a6b6

Please sign in to comment.