Ensure we don't cause a mess with the auth providers

This commit is contained in:
DaneEveritt 2022-05-22 18:16:47 -04:00
parent 3ae70efc14
commit dca53611ff
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 233 additions and 15 deletions

View file

@ -14,11 +14,12 @@ export interface LoginData {
export default ({ username, password, recaptchaData }: LoginData): Promise<LoginResponse> => {
return new Promise((resolve, reject) => {
http.post('/auth/login', {
user: username,
password,
'g-recaptcha-response': recaptchaData,
})
http.get('/sanctum/csrf-cookie')
.then(() => http.post('/auth/login', {
user: username,
password,
'g-recaptcha-response': recaptchaData,
}))
.then(response => {
if (!(response.data instanceof Object)) {
return reject(new Error('An error occurred while processing the login request.'));