Move api to v1 folder
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user