Skip to content

Commit

Permalink
fix: options validation rpId doesn't have to be an url
Browse files Browse the repository at this point in the history
  • Loading branch information
tamassoltesz committed Feb 14, 2025
1 parent 0b2b31a commit e109bf8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ public static void validateOptions(String origin, String rpId, Long timeout, Str
private static void validateOrigin(String origin, String rpId) throws InvalidWebauthNOptionsException {
try {
URL originUrl = new URL(origin);
URL rpIdUrl = new URL(rpId);
if (!originUrl.getHost().contains(rpIdUrl.getHost())) {
if (!originUrl.getHost().contains(rpId)) {
throw new InvalidWebauthNOptionsException("Origin does not match RelyingParty Id");
}
} catch (MalformedURLException e) {
throw new InvalidWebauthNOptionsException("Origin and rpId have to be valid urls!");
throw new InvalidWebauthNOptionsException("Origin has to be a valid url!");
}
}

Expand Down

0 comments on commit e109bf8

Please sign in to comment.