[webexteams] Remove the access token when the thing is removed (#14979)

Related to #14818

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2023-05-11 22:03:00 +02:00 committed by GitHub
parent 14e7109a25
commit 88413c001d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 7 deletions

View File

@ -147,11 +147,17 @@ public class WebexTeamsHandler extends BaseThingHandler implements AccessTokenRe
OAuthClientService authService = this.authService;
if (authService != null) {
authService.removeAccessTokenRefreshListener(this);
}
oAuthFactory.ungetOAuthService(thing.getUID().getAsString());
}
cancelSchedulers();
}
@Override
public void handleRemoval() {
oAuthFactory.deleteServiceAndAccessToken(thing.getUID().getAsString());
super.handleRemoval();
}
private void createIntegrationOAuthClientService(WebexTeamsConfiguration config) {
String thingUID = this.getThing().getUID().getAsString();
logger.debug("Creating OAuth Client Service for {}", thingUID);