Skip to content

Commit d49994e

Browse files
committed
Return the correct URL to the mobile API to finish user registration
1 parent adb4ee8 commit d49994e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

myconext-server/src/main/java/myconext/api/UserController.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,13 @@ private ResponseEntity<Map<String, String>> doVerifyCodeExistingUser(VerifyOneTi
371371
user.getEmail(),
372372
delay,
373373
(int) (Math.log(delay / 1000) / Math.log(2))));
374-
String url = this.magicLinkUrl + "?h=" + hash;
374+
String url;
375+
if (samlAuthenticationRequest != null) {
376+
url = this.magicLinkUrl + "?h=" + hash;
377+
} else {
378+
//Mobile app
379+
url = this.idpBaseUrl + "/mobile/api/create-from-mobile-api/in-app?h=" + hash;
380+
}
375381
return ResponseEntity.status(201).body(Map.of("url", url));
376382
}
377383
throw new InvalidOneTimeLoginCodeException(String.format("Invalid oneTimeLoginCode entered for email %s, delay: %s, attempt: %s",

0 commit comments

Comments
 (0)