python-adminui icon indicating copy to clipboard operation
python-adminui copied to clipboard

Is there a way to redirect a user to the login page other than trying to access a restricted page?

Open jwag59 opened this issue 2 years ago • 1 comments

I'd like to have a button or Menu item that can be used to request login details. What I have now is a Menu item as follows: MenuItem('Login', '/login', icon="login"), And then I define the login page as:

@app.page('/login', 'Login Page', auth_needed='user')
def nodes_view_page():
   return [Header('This is the login redirect page', 3)]

I also redirect users on Login to '/' so they never see the actual login page. Of course this forces a login BUT it sends the 'No Permission' notification to the user ... which looks a bit strange if this is meant to simply be a link to a login prompt. Is there a way to bypass the Notification and simply allow the user to login with their credentials? Or even better, could there be an adminui app. option to enable the display of a 'Login' link on the top right of the 'top bar' if a user is not currently logged in, and if the user is logged in, it simply shows their login name (as it does now)?

jwag59 avatar Jun 22 '22 06:06 jwag59

good point

bigeyex avatar Jun 25 '22 03:06 bigeyex