sillsdev / languageforge-lexbox

Lexbox, SIL linguistic data hub
MIT License
7 stars 2 forks source link

Absolute URL detection in EmailService not working #1238

Closed myieye closed 1 week ago

myieye commented 1 week ago

Describe the bug This line in EmailService: if (new Uri(returnTo).IsAbsoluteUri) throw new ArgumentException($"returnTo must be relative, was: {returnTo}", nameof(returnTo));

Is throwing: returnTo must be relative, was: /api/User/acceptInvitation (Parameter 'returnTo')

Based on my fiddling, here are the options that seem to do what we're expecting: new Uri(returnTo, UriKind.RelativeOrAbsolute).IsAbsoluteUri Uri.IsWellFormedUriString(returnTo, UriKind.Absolute) or the inverse !Uri.IsWellFormedUriString(returnTo, UriKind.Relative)

Image