Skip to content

Commit 65fb923

Browse files
committed
fix: update vue to adapt to backend
1 parent ac52620 commit 65fb923

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/components/AuthInitiate.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
<script setup>
118118
import { ref, onMounted, onUnmounted } from "vue";
119119
import { getCookie } from "../utils/cookies";
120+
import { apiFetch } from "../utils/api";
120121
import { clearAuthState } from "../utils/auth";
121122
import Turnstile from "./Turnstile.vue";
122123
import Icon from "./Icon.vue";
@@ -125,7 +126,7 @@ const props = defineProps({
125126
action: {
126127
type: String,
127128
required: true,
128-
validator: (value) => ["signup", "login", "reset_password"].includes(value),
129+
validator: (value) => ["signup", "login", "reset"].includes(value),
129130
},
130131
});
131132
@@ -203,7 +204,7 @@ const initiateAuth = async () => {
203204
error.value = null;
204205
205206
try {
206-
const response = await fetch("/api/auth/initiate/", {
207+
const response = await apiFetch("/api/auth/init/", {
207208
method: "POST",
208209
headers: {
209210
"Content-Type": "application/json",

src/components/SetPasswordForm.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<div>
1414
<label for="password" class="block text-sm/6 font-medium text-gray-900">
15-
{{ action === "reset_password" ? "New Password" : "Password" }}
15+
{{ action === "reset" ? "New Password" : "Password" }}
1616
</label>
1717
<div class="mt-2 relative">
1818
<input
@@ -156,6 +156,7 @@
156156
<script>
157157
import { ref, computed, watch } from "vue";
158158
import { getAuthState } from "../utils/auth";
159+
import { apiFetch } from "../utils/api";
159160
import { getCookie } from "../utils/cookies";
160161
import {
161162
calculatePasswordStrength,
@@ -176,7 +177,7 @@ export default {
176177
action: {
177178
type: String,
178179
required: true,
179-
validator: (value) => ["signup", "reset_password"].includes(value),
180+
validator: (value) => ["signup", "reset"].includes(value),
180181
},
181182
showBackButton: {
182183
type: Boolean,
@@ -305,7 +306,7 @@ export default {
305306
? "/api/auth/signup/"
306307
: "/api/auth/password/";
307308
308-
const response = await fetch(endpoint, {
309+
const response = await apiFetch(endpoint, {
309310
method: "POST",
310311
headers: {
311312
"Content-Type": "application/json",

0 commit comments

Comments
 (0)