jeremyevans / rodauth

Ruby's Most Advanced Authentication Framework
http://rodauth.jeremyevans.net
MIT License
1.7k stars 94 forks source link

Add `remembered_session_id` to check if remembered #166

Closed bjeanes closed 3 years ago

bjeanes commented 3 years ago

I have a use-case where I need to check if the session has a valid remember cookie set but currently the code which validates the cookie's presence and contents is buried inside load_memory which both has side effects and early exits in the presence of a valid logged in session.

I'm hoping you won't be opposed to an extraction like the one herein. Let me know if you'd prefer a different name or it broken up a different way.

jeremyevans commented 3 years ago

I'm OK adding a method for this. A few issues with the current commit:

bjeanes commented 3 years ago

Whoops sorry about those whitespace changes, in particular—I had excluded them in my first commit but then amended it and accidentally included.

I've pushed a new commit which adds the docs, leaves the CHANGELOG untouched, and preserves existing whitespace.

jeremyevans commented 3 years ago

This looks good. I've already done full prerelease testing for tomorrow's release, so I'll test and merge this on Monday.

jeremyevans commented 3 years ago

Cherry-picked at 3ea500a1412e9fb9e41c61162616d1f8af62d5b5