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

Redirect a non admin user who doesn't have access to AdminUI #4469

Open
vamshi9 opened this issue Oct 18, 2017 · 4 comments
Open

Redirect a non admin user who doesn't have access to AdminUI #4469

vamshi9 opened this issue Oct 18, 2017 · 4 comments
Labels

Comments

@vamshi9
Copy link

vamshi9 commented Oct 18, 2017

When a user clicks on a button on my page it goes to signin page and gives you're already logged in. How do I've to redirect to user(not admin) dashboard?

@dholbrook86
Copy link

Maybe explain more about what you're trying to accomplish. I'm not understanding.

@icyretribution
Copy link

There is no predefined user dashboard other than the default keystone admin node module.

In order to have one, you will at minimum need to create a respective route, template, and middleware definition.

@vamshi9
Copy link
Author

vamshi9 commented Oct 21, 2017

@dholbrook86 @icyretribution When I click some link on front end lets say - '/schedule' it'll go to the middleware for authorization(middleware.requireUser). Once signed in as a user who is not an admin, it is supposed to return to /whateve/url he clicked rather going to /keystone. I've tried out #1489 but function callback is working out. It is returning 'test' to the console.
`
keystone.set('signin redirect', function(user,req, res){
console.log('test');
var url = (user.isAdmin) ? '/keystone' : '/schedule';
res.redirect(url);
});

`
Would you please check this out!

@dholbrook86
Copy link

So I've been neck deep in Keystone for the past month. I've noticed a LOT of sub features of the framework that just simply aren't working. For example, if you disable auth, you should be able to hit /keystone without the need to log in. Not the case. It simply breaks. I had to force a session object and comment out a piece of code in the Keystone core to fix it.
There are a ton of issues that need to be resolved. Your issue might be one of those.

Have you pulled your own version of Keystone down for your own development? If not, I would suggest doing that and hacking things up outside of the hooks and settings Keystone give you. Once I did that, my life became a lot easier. I unfortunately will not be able to upgrade in the future. Well maybe, but you get what I'm saying.

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

4 participants