Move api to v1 folder

This commit is contained in:
2022-06-27 09:08:26 -05:00
parent 6fe79a1892
commit 2fa58305cb
15 changed files with 43 additions and 35 deletions

View File

@@ -9,7 +9,7 @@ export default initAuth0({
routes: {
callback:
process.env.NEXT_PUBLIC_REDIRECT_URI ||
"http://localhost:3000/api/callback",
"http://localhost:3000/api/v1/callback",
postLogoutRedirect:
process.env.NEXT_PUBLIC_POST_LOGOUT_REDIRECT_URI ||
"http://localhost:3000",

View File

@@ -6,7 +6,7 @@ export async function fetchUser(cookie = "") {
}
const res = await fetch(
"/api/me",
"/api/v1/me",
cookie
? {
headers: {
@@ -53,7 +53,7 @@ export function useFetchUser({ required } = {}) {
if (isMounted) {
// When the user is not logged in but login is required
if (required && !user) {
window.location.href = "/api/login";
window.location.href = "/api/v1/login";
return;
}
setUser(user);