Add session validation checks before executing vehicle commands
Some checks failed
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Failing after 27s
Some checks failed
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Failing after 27s
This commit is contained in:
14
vehicle.go
14
vehicle.go
@ -451,7 +451,7 @@ func (v *Vehicle) GetClimatePresets() error {
|
||||
}
|
||||
|
||||
// Validate session before executing the request
|
||||
if v.client.validateSession() {
|
||||
if !v.client.validateSession() {
|
||||
v.client.logger.Error(APP_ERRORS["SESSION_EXPIRED"])
|
||||
return errors.New(APP_ERRORS["SESSION_EXPIRED"])
|
||||
}
|
||||
@ -517,7 +517,7 @@ func (v *Vehicle) GetClimateQuickPresets() error {
|
||||
}
|
||||
|
||||
// Validate session before executing the request
|
||||
if v.client.validateSession() {
|
||||
if !v.client.validateSession() {
|
||||
v.client.logger.Error(APP_ERRORS["SESSION_EXPIRED"])
|
||||
return errors.New(APP_ERRORS["SESSION_EXPIRED"])
|
||||
}
|
||||
@ -560,7 +560,7 @@ func (v *Vehicle) GetClimateUserPresets() error {
|
||||
}
|
||||
|
||||
// Validate session before executing the request
|
||||
if v.client.validateSession() {
|
||||
if !v.client.validateSession() {
|
||||
v.client.logger.Error(APP_ERRORS["SESSION_EXPIRED"])
|
||||
return errors.New(APP_ERRORS["SESSION_EXPIRED"])
|
||||
}
|
||||
@ -612,7 +612,7 @@ func (v *Vehicle) GetVehicleStatus() error {
|
||||
}
|
||||
|
||||
// Validate session before executing the request
|
||||
if v.client.validateSession() {
|
||||
if !v.client.validateSession() {
|
||||
v.client.logger.Error(APP_ERRORS["SESSION_EXPIRED"])
|
||||
return errors.New(APP_ERRORS["SESSION_EXPIRED"])
|
||||
}
|
||||
@ -680,7 +680,7 @@ func (v *Vehicle) GetVehicleCondition() error {
|
||||
}
|
||||
|
||||
// Validate session before executing the request
|
||||
if v.client.validateSession() {
|
||||
if !v.client.validateSession() {
|
||||
v.client.logger.Error(APP_ERRORS["SESSION_EXPIRED"])
|
||||
return errors.New(APP_ERRORS["SESSION_EXPIRED"])
|
||||
}
|
||||
@ -737,7 +737,7 @@ func (v *Vehicle) GetVehicleHealth() error {
|
||||
}
|
||||
|
||||
// Validate session before executing the request
|
||||
if v.client.validateSession() {
|
||||
if !v.client.validateSession() {
|
||||
v.client.logger.Error(APP_ERRORS["SESSION_EXPIRED"])
|
||||
return errors.New(APP_ERRORS["SESSION_EXPIRED"])
|
||||
}
|
||||
@ -802,7 +802,7 @@ func (v *Vehicle) executeServiceRequest(params map[string]string, reqUrl, pollin
|
||||
}
|
||||
|
||||
// Validate session before executing the request
|
||||
if v.client.validateSession() {
|
||||
if !v.client.validateSession() {
|
||||
v.client.logger.Error(APP_ERRORS["SESSION_EXPIRED"])
|
||||
return errors.New(APP_ERRORS["SESSION_EXPIRED"])
|
||||
}
|
||||
|
Reference in New Issue
Block a user