Skip to content

Commit

Permalink
(bug) unable to reset OpenApi token
Browse files Browse the repository at this point in the history
  • Loading branch information
gnepud committed Sep 6, 2024
1 parent 7281ad3 commit b448137
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/models/open_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b448137

Please sign in to comment.