refactor: Update API endpoint paths from "_allauth" to "auth" for consistency

This commit is contained in:
Sean Morley
2025-02-23 17:04:20 -05:00
parent d5311bb71e
commit b1068d27b0
16 changed files with 56 additions and 202 deletions

View File

@@ -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',

View File

@@ -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();

View File

@@ -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