feat: convert login data to snake_case programatically
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
b3922c7c10
commit
197d5dc301
|
@ -1,5 +1,6 @@
|
|||
import {HTTPFactory} from '@/http-common'
|
||||
import {i18n, getCurrentLanguage, saveLanguage} from '@/i18n'
|
||||
import {objectToSnakeCase} from '../../helpers/case'
|
||||
import {LOADING} from '../mutation-types'
|
||||
import UserModel from '@/models/user'
|
||||
import UserSettingsService from '@/services/userSettings'
|
||||
|
@ -90,18 +91,8 @@ export default {
|
|||
// Delete an eventually preexisting old token
|
||||
removeToken()
|
||||
|
||||
const data = {
|
||||
username: credentials.username,
|
||||
password: credentials.password,
|
||||
long_token: credentials.longToken,
|
||||
}
|
||||
|
||||
if (credentials.totpPasscode) {
|
||||
data.totp_passcode = credentials.totpPasscode
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await HTTP.post('login', data)
|
||||
const response = await HTTP.post('login', objectToSnakeCase(credentials))
|
||||
// Save the token to local storage for later use
|
||||
saveToken(response.data.token, true)
|
||||
|
||||
|
|
Reference in New Issue