Giter Club home page Giter Club logo

Comments (6)

tulkas85 avatar tulkas85 commented on July 30, 2024

I could use a fake user to force redirect to other page, and for this user I can block access to other page.
So now, I can send user to forgotPassword page, and I can send mail.
Now user receive e-mail, and I need to manage redirect to link in e-mail, something like
https://ip:port/users/password/edit?reset_password_token=fZCr2zRt5DzQnxxx1FTo

But I can't access in method LogonMB. isLoggedIn() to request url and parameters, I have nullPointerException on FacesContext.getCurrentInstance()

from admin-starter.

rmpestano avatar rmpestano commented on July 30, 2024

Hi there, use admin.ignoredResources in admin-config.properties:

admin.ignoredResources=/users/password/edit

More detais see here:https://adminfaces.github.io/docs/1.0.0/index.html#configuration

from admin-starter.

tulkas85 avatar tulkas85 commented on July 30, 2024

I set
admin.ignoredResources=forgotPassword
where forgotPassword.xhtml is the page that filter must ignore. It's on same directory of login and index pages of admin-starter, but filter always redirect to login page

I try also :
admin.ignoredResources=/forgotPassword
admin.ignoredResources=/forgotPassword.xhtml
admin.ignoredResources=forgotPassword.xhtml

from admin-starter.

rmpestano avatar rmpestano commented on July 30, 2024

You can also change isLoggedIn logic in LogonMB here to return true if user is in forgotPassword page, ex:

  @Override
    public boolean isLoggedIn() {

        return currentUser != null || FacesContext.getCurrentInstance().getViewRoot().getViewId().equals("forgotPassword.xhtml");
    }

from admin-starter.

tulkas85 avatar tulkas85 commented on July 30, 2024

sorry
admin.ignoredResources=forgotPassword
works.

In all test that I've done, FacesContext.getCurrentInstance() always null in isLoggedIn methods if user is not logged

from admin-starter.

rmpestano avatar rmpestano commented on July 30, 2024

I think in early request cycles It will be, adding a null check may do the trick.

Glad that the ignoreResources config works

from admin-starter.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.