Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing context part of path for recover password link in MD login form #60

Closed
karma4u101 opened this issue Dec 30, 2015 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@karma4u101
Copy link
Owner

Link to recover password page in MaterialMegaMetaProtoUser login form will be broken if app has a context path != "/". This issue has been found both in FoBo v1.5 compiled for 2.6.2 and 3.0.

@karma4u101 karma4u101 self-assigned this Dec 30, 2015
@karma4u101 karma4u101 added this to the 1.5.1 milestone Dec 30, 2015
@karma4u101 karma4u101 changed the title Missing context path for recover password link in login form Missing context in path for recover password link in login form Dec 30, 2015
@karma4u101
Copy link
Owner Author

If someone looks at this issue and has a answer to the why question blow hen is welcome to enlightening me. Both FoBo and Lift ProtoUser is using lostPasswordPath in loginXhtml like this

... href={lostPasswordPath.mkString("/", "/", "")} ...

but only FoBo's override of loginXhtml seems affected by this issue.

Some ProtoUser code from Lift also used by FoBo that builds up the path.

def lostPasswordSuffix = "lost_password"
lazy val lostPasswordPath = thePath(lostPasswordSuffix) 
protected def thePath(end: String): List[String] = basePath ::: List(end)
def basePath: List[String] = "user_mgt" :: Nil

This dose clearly not add the context part of the full path to the lostPasswordPath as this is a list ["user_mgt","lost_password"] giving a relative path "/user_mgt/lost_password" created by mkString("/", "/", "") so the solution to the issue is else where to be found.

To test and compare the behaviour I have the following context path parts, "lift-advanced-md" for testing the above. To check the behaviour of Lift vanila ProtoUser I installed the lift_basic template with context path "lift_basic". Then the tests shows that with "list_basic" the context part is present but with "lift-advanced-md" the context part of the full path is missing hence the page can not be found. Why is there a difference in behaviour ?

Concluding that there seems to be a difference in behaviour between FoBo originating code and the use of vanilla ProtoUser the context part of the path needs to be added to FoBo's override of the loginXhtml form code.

Using the following expression dose fix the issue

val lpwPath = if (S.contextPath != "") S.contextPath + lostPasswordPath.mkString("/", "/", "") else lostPasswordPath.mkString("/", "/", "") 
:
...href={lpwPath}...

@karma4u101 karma4u101 changed the title Missing context in path for recover password link in login form Missing context part of path for recover password link in login form Dec 30, 2015
@karma4u101 karma4u101 changed the title Missing context part of path for recover password link in login form Missing context part of path for recover password link in MD login form Dec 30, 2015
@karma4u101
Copy link
Owner Author

In the material design form we currently need to have

val lpwPath = if (S.contextPath != "") 
  S.contextPath + lostPasswordPath.mkString("/", "/", "") 
  else lostPasswordPath.mkString("/", "/", "") 
:
<md-button class="md-primary" href={ lpwPath } >{ ... }</md-button> 

In the bootstrap form we can still have (same as in Lift ProtoUser)

<a href={ lostPasswordPath.mkString("/", "/", "") }>{ ... }</a>

Could it be that Lift has a parsing phase that manipulates standard html elements/attributes but avoids custom elements/attributes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant