How to insert BrowserID login button in defaultLayout

Part of the beauty of BrowserID is that there are very few infrastructure options on your website, you just insert a button with some javascript and then set up a callback route to process the data after authentication. I would like to be able to embed the login button in the BrowserID browser at the top of all my pages inside the defaultLayout template (and then conditionally show / hide it based on the login status), but at the moment I see no way to do this. The Auth sub-site works by embedding its "login page" inside the defaultLayout template, but besides that, it seems to be a complete black box.

I would very much like that I couldn’t either turn my own handler to enter the browser, or redirect the user to a completely separate page, on which, probably, there will be only one button for entering the browser BrowserID.

Is there a way to accomplish what I'm trying to do, which I am just missing, or is it my best bet - really, to collapse my login code into the BrowserID browser?

Looking at the source code of the Yesod.Auth.BrowserId module, it looks like I could do something like:

(apLogin authBrowserId) <not sure what would go here>

to get the login widget, but grabbing the laughter of a plugin like this is dirty.

+5
source share
1 answer

createOnClick, Javascript, // . .

+3

All Articles