Forgotten password retrieval - Invalid URI

  • 77 Views
  • Last Post 23 March 2017
  • Topic Is Solved
celt posted this 20 March 2017

Hello,

Sorry if this question was asked... I get a following exception once user requests an email reset:

 

Invalid URI: The format of the URI could not be determined.

[UriFormatException: Invalid URI: The format of the URI could not be determined.]
   System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) +6844372
   System.Uri..ctor(String uriString) +21
etc...

Would someone know what would be the issue here?

Order By: Standard | Newest | Votes
YodasMyDad posted this 20 March 2017

Debug it and find what line it's on

celt posted this 20 March 2017

This is what I call quick support

It doesn't break on debug when exception is thrown... However I'm not compiling it from the source code but with dll's, I guess this is the reason?

celt posted this 20 March 2017

Ok, I copied the source.

it's this line:

Line 1325:                var url = new Uri(string.Concat(settings.ForumUrl.TrimEnd('/'), Url.Action("ResetPassword", "Members", new { user.Id, token = user.PasswordResetToken })));

 

celt posted this 20 March 2017

I found the error. I had inserted forum url in admin dashboard without http(s):// in front and this was causing this exception...

I think this should do the trick:

var url = new Uri(string.Concat(new UriBuilder(settings.ForumUrl.TrimEnd('/')).Uri.ToString(), Url.Action("ResetPassword", "Members", new { user.Id, token = user.PasswordResetToken })));

I'm not sure if it's the most elegant solution or if it works, it's a bit late to try to recompile everything with source code, but I think this should do it.

I found a few more small bugs, but I forgot them. I should probably contribute to the source a bit more

 

 

  • Liked by
  • YodasMyDad
YodasMyDad posted this 23 March 2017

Would appreciate if you could contribute and do a PR for any bugs.

Close