Update index.html

Ryan Danenberg committed commit8e0cb66d93d7ed724e9f4592b9bca0d3d77967ac Browse files
1 file changed+0−25
index.html+0−25View file
@@ -1674,31 +1674,6 @@
body: JSON.stringify({ email: demo.email, password: demo.password })
});
- if (!res.ok && (res.status === 401 || res.status === 404 || res.status === 400)) {
- const regRes = await fetch('/api/auth/register', {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({
- email: demo.email,
- password: demo.password,
- name: demo.name,
- role: demo.role
- })
- });
- if (regRes.ok) {
- const regData = await regRes.json();
- token = regData.token || regData.accessToken || regData.jwt;
- user = regData.user || regData;
- }
- if (!token) {
- res = await fetch('/api/auth/login', {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ email: demo.email, password: demo.password })
- });
- }
- }
-
if (res && res.ok) {
const data = await res.json();
token = data.token || data.accessToken || data.jwt;