hard token regen
This commit is contained in:
parent
b0c763483d
commit
082f3833e8
1 changed files with 3 additions and 3 deletions
|
@ -251,14 +251,14 @@ func (rc *rocketchat) accessTokenExists() (bool, error) {
|
|||
|
||||
func (rc *rocketchat) regenerateAccessToken() (string, error) {
|
||||
body := map[string]string{"tokenName": "scim"}
|
||||
resp, err := rc.R().SetBody(body).Post("/api/v1/users.regeneratePersonalAccessToken")
|
||||
resp, err := rc.R().SetBody(body).Post("/api/v1/users.removePersonalAccessToken")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if resp.IsError() {
|
||||
return "", fmt.Errorf("failed to regenerate access token - %s", resp.Body())
|
||||
return "", fmt.Errorf("failed to remove access token - %s", resp.Body())
|
||||
}
|
||||
return gjson.Get(string(resp.Body()), "token").String(), nil
|
||||
return rc.generateAccessToken()
|
||||
}
|
||||
|
||||
func (rc *rocketchat) generateAccessToken() (string, error) {
|
||||
|
|
Loading…
Reference in a new issue