Implement signout feature in dashboard

Product: PowerShell Universal
Version: 1.5.9

I have the dashboard implemented and working as expected using Root “/” so when user visit the URL the user needs to login and after success the user will be taken directly to the dashboard.

the issue is if the user close the browser and reopen and try to visit the URL again, no authentication is populated and the user will be presented with the dashboard right away.

the question is how to implement a signout button in the dashboard to logout the user when clicked without having the user go to /admin page to signout.
Note: in the above scenario users are not and should not be aware of /admin page.

Thank you.

Hello @wsl2001 I am guessing this is a feature request for Powershell Universal, however if you looking for a workaround, then I did do this custom component:-
https://marketplace.universaldashboard.io/Dashboard/UniversalDashboard.UDStickyNavbar
Which you could implement the same hyperlink which is used for the signout into this sticky navbar. Just a thought :thinking:

@psDevUK
Thank you for the idea, it might work this way but am trying to find what command initiate the sign out as well so if i chose to use a component i can implement the sign out code in it.

do you use the form base authentication ? or something else ?
the endpoint is '/api/v1/signout

@AlonGvili
am using form base authentication

Second this!
A sign out button or what ever should be perfect in the navbar!

@adam maybe something to put in the add function list?

1 Like

Dear @adam

I saw that you just implemented this :smiley:

However can I ask you how can we enable the button? It’s not there by default (at least not in the nightly 1.5.15) and I didn’t see a specific parameter for New-UDDashboard.

Thanks for the clarification!

Best,
Don

should be coming in PowerShell Universal 1.5.16

Hey @wsl2001

OK understand but since Adam flagged it as “Fixed in Nightly Build” I thought it’s already there… But maybe in the nightly builds of v.1.6? :wink:
…I haven’t tested yet.

Thanks,
Don

Hmmm I thought that was merged into the 1.6 nightly build. I’ll have to look. We don’t do 1.5 nightly builds.

OK thanks for the clarification.
However there is a nightly build of 1.5.15 dated April 13th… And I’m using this one right now which contains already a lot of fixes from you… :wink:

KR
Don

Ah. Yeah sometimes we publish those builds for customers to try out fixes before they are released to ensure that they fix the issue in their environment.

@adam

The new signout feature in 1.5.16 works fine except when clicked it ends up with blank page, i think it would be much nicer to have the signout redirect to the login screen instead of a blank page.

Yes, I can confirm what @wsl2001 said as well. It executes the signoff API call and then just “sits” there.
A redirect to the login screen should be triggered just after the signout and then it would be perfect! :+1:t2:

Strange…We’ll get that fixed…