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");
|
const token = sessionStorage.getItem("nxtgauge_access_token");
|
||||||
if (token) {
|
if (token) {
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/gateway/auth/session", {
|
const res = await fetch("/api/auth/session", {
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ async function fetchSession(): Promise<AuthUser | null> {
|
||||||
const token = getToken();
|
const token = getToken();
|
||||||
if (!token) return null;
|
if (!token) return null;
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/gateway/auth/session", {
|
const res = await fetch("/api/auth/session", {
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
|
|
|
||||||
|
|
@ -668,7 +668,7 @@ export default function RuntimeDashboardPage() {
|
||||||
const email = authEmail || getEmailFromStorage();
|
const email = authEmail || getEmailFromStorage();
|
||||||
if (!email) return;
|
if (!email) return;
|
||||||
|
|
||||||
const checkRes = await fetch("/api/gateway/auth/check-email", {
|
const checkRes = await fetch("/api/auth/check-email", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
|
|
@ -691,7 +691,7 @@ export default function RuntimeDashboardPage() {
|
||||||
|
|
||||||
const token = getToken();
|
const token = getToken();
|
||||||
if (token) {
|
if (token) {
|
||||||
const switchRes = await fetch("/api/gateway/auth/switch-role", {
|
const switchRes = await fetch("/api/auth/switch-role", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ export default function ForgotPasswordRoute() {
|
||||||
}
|
}
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
try {
|
try {
|
||||||
const res = await fetch('/api/gateway/auth/forgot-password', {
|
const res = await fetch('/api/auth/forgot-password', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ email: email().trim().toLowerCase() }),
|
body: JSON.stringify({ email: email().trim().toLowerCase() }),
|
||||||
|
|
@ -82,7 +82,7 @@ export default function ForgotPasswordRoute() {
|
||||||
}
|
}
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
try {
|
try {
|
||||||
const res = await fetch('/api/gateway/auth/reset-password', {
|
const res = await fetch('/api/auth/reset-password', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ export default function LoginRoute() {
|
||||||
}
|
}
|
||||||
setCheckingRole(true);
|
setCheckingRole(true);
|
||||||
try {
|
try {
|
||||||
const response = await fetch("/api/gateway/auth/check-email", {
|
const response = await fetch("/api/auth/check-email", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
|
|
@ -243,7 +243,7 @@ export default function LoginRoute() {
|
||||||
}
|
}
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/gateway/auth/login", {
|
const res = await fetch("/api/auth/login", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
|
|
@ -283,7 +283,7 @@ export default function LoginRoute() {
|
||||||
|
|
||||||
if (discoveredRoleKeys.length === 0 || isJobSeekerRole(discoveredActiveRole)) {
|
if (discoveredRoleKeys.length === 0 || isJobSeekerRole(discoveredActiveRole)) {
|
||||||
try {
|
try {
|
||||||
const checkRes = await fetch("/api/gateway/auth/check-email", {
|
const checkRes = await fetch("/api/auth/check-email", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
|
|
@ -324,7 +324,7 @@ export default function LoginRoute() {
|
||||||
let desiredRoleKey = discoveredActiveRole;
|
let desiredRoleKey = discoveredActiveRole;
|
||||||
if (finalAccessToken && requestedRoleKey && requestedRoleKey !== discoveredActiveRole) {
|
if (finalAccessToken && requestedRoleKey && requestedRoleKey !== discoveredActiveRole) {
|
||||||
try {
|
try {
|
||||||
const switchRes = await fetch("/api/gateway/auth/switch-role", {
|
const switchRes = await fetch("/api/auth/switch-role", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
@ -385,7 +385,7 @@ export default function LoginRoute() {
|
||||||
setError("");
|
setError("");
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/gateway/auth/resend-otp", {
|
const res = await fetch("/api/auth/resend-otp", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
|
|
@ -409,7 +409,7 @@ export default function LoginRoute() {
|
||||||
}
|
}
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
try {
|
try {
|
||||||
const verifyRes = await fetch("/api/gateway/auth/verify-email", {
|
const verifyRes = await fetch("/api/auth/verify-email", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue