mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 22:42:32 -05:00
add rotate api token button
This commit is contained in:
1 parent
7dc342a6f9
commit
ab9cc52bcc
3 files changed
+12
-1
No files matched your search
@@ -4,4 +4,14 @@ class ApiSettingsController < ApplicationController
|
||||
def index
|
||||
authorize!(:read, current_user.access_token)
|
||||
end
|
||||
|
||||
def create
|
||||
authorize!(:manage, current_user.access_token)
|
||||
|
||||
current_user.access_token.token = SecureRandom.base58(AccessToken::TOKEN_LENGTH)
|
||||
|
||||
current_user.access_token.save!
|
||||
|
||||
redirect_back(fallback_location: settings_api_index_path, notice: 'API token as been updated.')
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user