volatiletech / authboss

The boss of http auth.
MIT License
3.85k stars 207 forks source link

"Remember me" enabled by default if module installed #282

Open frederikhors opened 4 years ago

frederikhors commented 4 years ago

Issue opened for the creation of a wiki page that summarizes the doubts and problems for newbies (https://github.com/volatiletech/authboss/issues/210).


I have read these lines but I have not been able to understand if there is a way to avoid the rm field in the login form and activate the "remember me" module by default if present.

In other words if in my authboss.Config there is a (let's say) AutoRememberMe = true option I want enable by default the "Remember me" module as if in my form I had checked the rm field.

Does this make sense?

aarondl commented 4 years ago

Turning the module off is done by not importing the module. Is there a reason you'd want to both import it but also not use it?

frederikhors commented 4 years ago

I badly explained myself. I'm sorry.

I would like to avoid passing the "rm = true" field from the client (javascript or server-rendered form) during the login phase.

aarondl commented 4 years ago

Ah, you would need to add a new feature to the remember me module to "always remember". But I think you would just add a hidden field called rm.

frederikhors commented 4 years ago

you would just add a hidden field called rm

Yep. I'm doing this right now. But I think it's an hacky way. Don't you think?

aarondl commented 4 years ago

That's why I said you either have to do that or add a feature to authbosses module haha. I think that in the realm of hacky things this is one of the least hacky things there is. It's like sending a parameter into a function. No big deal. Costs next to nothing.