restored success/error redirects

This commit is contained in:
Sebastian Stenzel
2022-04-28 12:59:27 +02:00
parent 9f0e269baf
commit d4b3eff42f
2 changed files with 3 additions and 2 deletions

View File

@@ -28,8 +28,9 @@ class AuthFlowTask extends Task<String> {
@Override
protected String call() throws IOException, InterruptedException {
// TODO configure redirectURIs with deviceId from authFlowContext
var response = AuthFlow.asClient(hubConfig.clientId) //
.withSuccessRedirect(URI.create(hubConfig.authSuccessUrl + "&device=" + authFlowContext.deviceId())) //
.withErrorRedirect(URI.create(hubConfig.authErrorUrl + "&device=" + authFlowContext.deviceId())) //
.authorize(URI.create(hubConfig.authEndpoint), redirectUriConsumer) //
.getAccessToken(URI.create(hubConfig.tokenEndpoint));
var json = JsonParser.parseString(response);