Skip to content
Snippets Groups Projects
Commit f4ec789f authored by Simon Urli's avatar Simon Urli
Browse files

XWIKI-19591: Local users of subwikis can't recover password or username

  * Add missing revapi ignores for changes related to reset password
  * Fix a test by using the proper action resource URL
parent cd4c33dc
No related branches found
No related tags found
No related merge requests found
......@@ -161,6 +161,26 @@
</item>
</differences>
</revapi.differences>
<revapi.differences>
<justification>Unstable API changes</justification>
<criticality>allowed</criticality>
<differences>
<item>
<ignore>true</ignore>
<code>java.field.removed</code>
<old>field org.xwiki.security.authentication.AuthenticationAction.FORGOT_USERNAME</old>
<justification>The field has been renamed RETRIEVE_USERNAME.</justification>
</item>
<item>
<ignore>true</ignore>
<code>java.method.numberOfParametersChanged</code>
<old>method void org.xwiki.security.authentication.AuthenticationResourceReference::&lt;init&gt;(org.xwiki.security.authentication.AuthenticationAction)</old>
<new>method void org.xwiki.security.authentication.AuthenticationResourceReference::&lt;init&gt;(org.xwiki.model.reference.WikiReference, org.xwiki.security.authentication.AuthenticationAction)</new>
<justification>Needed change to allow using the resource on subwikis.</justification>
</item>
</differences>
</revapi.differences>
</analysisConfiguration>
</configuration>
</plugin>
......
......@@ -227,7 +227,8 @@ private String getResetLink(String emailContent, String userName)
String result = null;
// Use a regex to extract the password reset link
Pattern resetLinkPattern = Pattern.compile("http[^\\s]+?authenticate/reset\\?u=" + userName + "\\&v=\\w+");
Pattern resetLinkPattern = Pattern.compile(
String.format("http[^\\s]+?%s\\?u=%s\\&v=\\w+", ResetPasswordPage.RESET_PASSWORD_URL_RESOURCE, userName));
Matcher matcher = resetLinkPattern.matcher(emailContent);
if (matcher.find()) {
result = matcher.group();
......
......@@ -32,6 +32,11 @@
*/
public class ResetPasswordPage extends ViewPage
{
/**
* Resource action used for the reset password handling.
*/
public static final String RESET_PASSWORD_URL_RESOURCE = "authenticate/resetpassword";
@FindBy(id = "u")
private WebElement userNameInput;
......@@ -46,8 +51,7 @@ public class ResetPasswordPage extends ViewPage
public static ResetPasswordPage gotoPage()
{
getUtil().gotoPage(getUtil().getBaseURL() + "authenticate/resetpassword");
getUtil().gotoPage(getUtil().getBaseURL() + RESET_PASSWORD_URL_RESOURCE);
return new ResetPasswordPage();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment