refactor: Update API endpoint paths from "_allauth" to "auth" for consistency
This commit is contained in:
@@ -16,7 +16,7 @@ export const actions: Actions = {
|
||||
|
||||
let csrfToken = await fetchCSRFToken();
|
||||
|
||||
let res = await fetch(`${endpoint}/_allauth/browser/v1/auth/password/request`, {
|
||||
let res = await fetch(`${endpoint}/auth/browser/v1/auth/password/request`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -29,20 +29,17 @@ export const actions: Actions = {
|
||||
const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
|
||||
const csrfToken = await fetchCSRFToken();
|
||||
|
||||
const response = await event.fetch(
|
||||
`${serverEndpoint}/_allauth/browser/v1/auth/password/reset`,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Cookie: `csrftoken=${csrfToken}`,
|
||||
'X-CSRFToken': csrfToken,
|
||||
Referer: event.url.origin // Include Referer header
|
||||
},
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({ key: key, password: password })
|
||||
}
|
||||
);
|
||||
const response = await event.fetch(`${serverEndpoint}/auth/browser/v1/auth/password/reset`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Cookie: `csrftoken=${csrfToken}`,
|
||||
'X-CSRFToken': csrfToken,
|
||||
Referer: event.url.origin // Include Referer header
|
||||
},
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({ key: key, password: password })
|
||||
});
|
||||
|
||||
if (response.status !== 401) {
|
||||
const error_message = await response.json();
|
||||
|
||||
@@ -11,7 +11,7 @@ export const load = (async (event) => {
|
||||
const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
|
||||
const csrfToken = await fetchCSRFToken();
|
||||
|
||||
let verifyFetch = await event.fetch(`${serverEndpoint}/_allauth/browser/v1/auth/email/verify`, {
|
||||
let verifyFetch = await event.fetch(`${serverEndpoint}/auth/browser/v1/auth/email/verify`, {
|
||||
headers: {
|
||||
Cookie: `csrftoken=${csrfToken}`,
|
||||
'X-CSRFToken': csrfToken
|
||||
|
||||
Reference in New Issue
Block a user