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

Conditional redirect_path Based on Current User. #136

Open
Austin-dv-Evans opened this issue Oct 15, 2021 · 1 comment
Open

Conditional redirect_path Based on Current User. #136

Austin-dv-Evans opened this issue Oct 15, 2021 · 1 comment

Comments

@Austin-dv-Evans
Copy link

Hello, I am wondering if it is possible to conditionally return one of two redirections based on the current user type. It appears that I cant pass a current_user third argument to the config.redirect_path. Is there any way I can access current_user from within this configuration?

I am hoping to do something like this.

config.redirect_path = lambda { |request, params, current_user| current_user.user_type_x ? '/path_one' : '/path_two' }

@flyerhzm
Copy link
Owner

@Austin-dv-Evans it doesn't support yet, but any PR is welcome

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

No branches or pull requests

2 participants