Skip to content

Commit bea400c

Browse files
committed
fix (onboarding): redirection issue
1 parent bdbf6fc commit bea400c

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/client/app/api/user/data/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const appServerUrl =
77
? process.env.INTERNAL_APP_SERVER_URL
88
: process.env.NEXT_PUBLIC_APP_SERVER_URL
99

10-
export const GET = withAuth(async function GET(request, { authHeader }) {
10+
export const POST = withAuth(async function POST(request, { authHeader }) {
1111
try {
1212
const response = await fetch(`${appServerUrl}/api/get-user-data`, {
1313
method: "POST",

src/client/app/onboarding/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ const OnboardingPage = () => {
588588

589589
const checkStatus = async () => {
590590
try {
591-
const response = await fetch("/api/user/data")
591+
const response = await fetch("/api/user/data", {method: "POST"})
592592
if (!response.ok) throw new Error("Could not fetch user data.")
593593
const result = await response.json()
594594
if (result?.data?.onboardingComplete) {

src/client/app/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Home = () => {
3636
const checkOnboardingStatus = async () => {
3737
setIsCheckingOnboarding(true)
3838
try {
39-
const response = await fetch("/api/user/data") // Uses the same API endpoint
39+
const response = await fetch("/api/user/data", { method: "POST" }) // Uses the same API endpoint
4040

4141
if (response.status === 401) {
4242
// This case is unlikely if useUser() works but is good to handle.

src/client/app/settings/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ export default function SettingsPage() {
10731073
const fetchData = useCallback(async () => {
10741074
try {
10751075
const [response, profileResponse] = await Promise.all([
1076-
fetch("/api/user/data"),
1076+
fetch("/api/user/data", { method: "POST" }),
10771077
fetch("/api/user/profile")
10781078
])
10791079
if (!response.ok) {

src/client/components/LayoutWrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export default function LayoutWrapper({ children }) {
158158
const checkStatus = async () => {
159159
// No need to set isLoading(true) here, it's already true by default.
160160
try {
161-
const res = await fetch("/api/user/data")
161+
const res = await fetch("/api/user/data", {method: "POST"})
162162
if (!res.ok) throw new Error("Could not verify user status.")
163163
const result = await res.json()
164164
const data = result?.data || {}

src/client/components/NotificationsOverlay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const NotificationsOverlay = ({ onClose, notifRefreshKey }) => {
129129

130130
const fetchUserTimezone = useCallback(async () => {
131131
try {
132-
const response = await fetch("/api/user/data")
132+
const response = await fetch("/api/user/data", { method: "POST" })
133133
if (!response.ok) throw new Error("Failed to fetch user data")
134134
const result = await response.json()
135135
const timezone = result?.data?.personalInfo?.timezone

0 commit comments

Comments
 (0)