Skip to content

Commit 8532657

Browse files
authored
Merge pull request #90 from jackbuehner/validate-via-post
fix: use POST instead of GET when validating credentials
2 parents 85f0307 + 98d7330 commit 8532657

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

frontend/lib/Login.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,16 @@
166166
}
167167
168168
// verify that the username and password are correct
169-
const response = await fetch(
170-
window.__iisBase +
171-
'auth.asmx/ValidateCredentials?username=' +
172-
encodeURIComponent(usernameValue.value) +
173-
'&password=' +
174-
encodeURIComponent(password)
175-
)
169+
const response = await fetch(window.__iisBase + 'auth.asmx/ValidateCredentials', {
170+
method: 'POST',
171+
headers: {
172+
'Content-Type': 'application/x-www-form-urlencoded',
173+
},
174+
body: new URLSearchParams({
175+
username: usernameValue.value,
176+
password: password,
177+
}),
178+
})
176179
.then(parseXmlResponse)
177180
.then((xmlDoc) => JSON.parse(xmlDoc.textContent || '{ success: false }') as CredentialsResponse)
178181
.catch(() => ({ success: false } as InvalidCredentialsResponse));

0 commit comments

Comments
 (0)