mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-28 09:24:24 +01:00
(bug) unable to reset OpenApi token
This commit is contained in:
parent
7281ad3bd4
commit
b448137392
@ -2,6 +2,8 @@
|
||||
|
||||
## Next release
|
||||
|
||||
- Fix a bug: unable to reset OpenApi token
|
||||
|
||||
## v6.3.32 2024 July 22
|
||||
|
||||
- Fix a bug: manager cannot pay a subscription(payment schedule) with a wallet
|
||||
|
@ -3,16 +3,16 @@
|
||||
# OpenAPI::Client keeps track of the authorized accesses to the 3-rd party API (aka. OpenAPI)
|
||||
class OpenAPI::Client < ApplicationRecord
|
||||
validates :name, presence: true
|
||||
validates_uniqueness_of :token
|
||||
validates :token, uniqueness: true
|
||||
|
||||
before_create :set_initial_token
|
||||
|
||||
def increment_calls_count
|
||||
update_column(:calls_count, calls_count+1)
|
||||
update_column(:calls_count, calls_count + 1)
|
||||
end
|
||||
|
||||
def regenerate_token
|
||||
update_attributes(token: generate_unique_secure_token)
|
||||
update(token: generate_unique_secure_token)
|
||||
end
|
||||
|
||||
private
|
||||
|
Loading…
Reference in New Issue
Block a user