浏览代码

restored success/error redirects

Sebastian Stenzel 2 年之前
父节点
当前提交
d4b3eff42f
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      pom.xml
  2. 2 1
      src/main/java/org/cryptomator/ui/keyloading/hub/AuthFlowTask.java

+ 1 - 1
pom.xml

@@ -143,7 +143,7 @@
 		<dependency>
 			<groupId>io.github.coffeelibs</groupId>
 			<artifactId>tiny-oauth2-client</artifactId>
-			<version>0.1.1</version>
+			<version>0.2.0</version>
 		</dependency>
 		<dependency>
 			<groupId>com.auth0</groupId>

+ 2 - 1
src/main/java/org/cryptomator/ui/keyloading/hub/AuthFlowTask.java

@@ -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);