fix(auth): change all /api/gateway/auth endpoints to /api/auth for forgot-password, login, and dashboard
Some checks failed
build-and-release / build (push) Failing after 1m6s
Some checks failed
build-and-release / build (push) Failing after 1m6s
This commit is contained in:
parent
1bf3191c49
commit
d7810ace96
5 changed files with 12 additions and 12 deletions
|
|
@ -100,7 +100,7 @@ export default function DashboardLayout(props: ParentProps) {
|
|||
const token = sessionStorage.getItem("nxtgauge_access_token");
|
||||
if (token) {
|
||||
try {
|
||||
const res = await fetch("/api/gateway/auth/session", {
|
||||
const res = await fetch("/api/auth/session", {
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ async function fetchSession(): Promise<AuthUser | null> {
|
|||
const token = getToken();
|
||||
if (!token) return null;
|
||||
try {
|
||||
const res = await fetch("/api/gateway/auth/session", {
|
||||
const res = await fetch("/api/auth/session", {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
|
|
|
|||
|
|
@ -668,7 +668,7 @@ export default function RuntimeDashboardPage() {
|
|||
const email = authEmail || getEmailFromStorage();
|
||||
if (!email) return;
|
||||
|
||||
const checkRes = await fetch("/api/gateway/auth/check-email", {
|
||||
const checkRes = await fetch("/api/auth/check-email", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||
credentials: "include",
|
||||
|
|
@ -691,7 +691,7 @@ export default function RuntimeDashboardPage() {
|
|||
|
||||
const token = getToken();
|
||||
if (token) {
|
||||
const switchRes = await fetch("/api/gateway/auth/switch-role", {
|
||||
const switchRes = await fetch("/api/auth/switch-role", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export default function ForgotPasswordRoute() {
|
|||
}
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const res = await fetch('/api/gateway/auth/forgot-password', {
|
||||
const res = await fetch('/api/auth/forgot-password', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ email: email().trim().toLowerCase() }),
|
||||
|
|
@ -82,7 +82,7 @@ export default function ForgotPasswordRoute() {
|
|||
}
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const res = await fetch('/api/gateway/auth/reset-password', {
|
||||
const res = await fetch('/api/auth/reset-password', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export default function LoginRoute() {
|
|||
}
|
||||
setCheckingRole(true);
|
||||
try {
|
||||
const response = await fetch("/api/gateway/auth/check-email", {
|
||||
const response = await fetch("/api/auth/check-email", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||
credentials: "include",
|
||||
|
|
@ -243,7 +243,7 @@ export default function LoginRoute() {
|
|||
}
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const res = await fetch("/api/gateway/auth/login", {
|
||||
const res = await fetch("/api/auth/login", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||
credentials: "include",
|
||||
|
|
@ -283,7 +283,7 @@ export default function LoginRoute() {
|
|||
|
||||
if (discoveredRoleKeys.length === 0 || isJobSeekerRole(discoveredActiveRole)) {
|
||||
try {
|
||||
const checkRes = await fetch("/api/gateway/auth/check-email", {
|
||||
const checkRes = await fetch("/api/auth/check-email", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||
credentials: "include",
|
||||
|
|
@ -324,7 +324,7 @@ export default function LoginRoute() {
|
|||
let desiredRoleKey = discoveredActiveRole;
|
||||
if (finalAccessToken && requestedRoleKey && requestedRoleKey !== discoveredActiveRole) {
|
||||
try {
|
||||
const switchRes = await fetch("/api/gateway/auth/switch-role", {
|
||||
const switchRes = await fetch("/api/auth/switch-role", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
@ -385,7 +385,7 @@ export default function LoginRoute() {
|
|||
setError("");
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const res = await fetch("/api/gateway/auth/resend-otp", {
|
||||
const res = await fetch("/api/auth/resend-otp", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||
credentials: "include",
|
||||
|
|
@ -409,7 +409,7 @@ export default function LoginRoute() {
|
|||
}
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const verifyRes = await fetch("/api/gateway/auth/verify-email", {
|
||||
const verifyRes = await fetch("/api/auth/verify-email", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||
credentials: "include",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue