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

How to implement Logout functionality #520

Closed
jaesharma opened this issue Jan 12, 2023 · 6 comments
Closed

How to implement Logout functionality #520

jaesharma opened this issue Jan 12, 2023 · 6 comments

Comments

@jaesharma
Copy link

As there is not inbuilt authentication flow, i added login page with passport.js local strategy based auth flow.
but how to achieve logout functionality with this now?

@felixmosh
Copy link
Owner

felixmosh commented Jan 12, 2023

Hi, a valid point, do you have any ideas?

Maybe we can allow additional links, that one of them will point to logout api

@jaesharma
Copy link
Author

don't know how bull board UI is coded, but if possible we can let user provide their own logout function.
so when user setup bull-board server, we can take a flag from user which signifies if user need logout or not.
if that flag is passed as true, Logout button will be shown in dashboard header somewhere.
also take callback function from user, which will be called as action of logout button click.

@felixmosh
Copy link
Owner

felixmosh commented Jan 13, 2023

It is not so simple to pass a function from backend (the only place that you have access to) to the client...
If you will be able to pass a custom links, you will be able to link to your logout logic api...

I'll review a possible solution

@oldo
Copy link

oldo commented Jan 20, 2023

I'm also coming across this issue. I think that as you've suggested @felixmosh where if you can just define in uiConfig an array of custom links that would be mapped as a set of buttons in the header or in a dropdown in the header. Then we just define a logout route that clears the auth cookie and redirects to the login page.

@felixmosh
Copy link
Owner

Yeah this is the path that I think to make...

@felixmosh
Copy link
Owner

felixmosh commented Jan 22, 2023

This is how it looks
image

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

3 participants