human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

On sign-in, users should be served up their most recently used role

Open cielf opened this issue 2 years ago • 12 comments

Summary

When a multi-roled user signs in, they should go to their most recently-used role.

Why

This has a couple of benefits: 1/ Continuation of flow -- when you sign in, you pick up closer to where you left off 2/ It is also a band-aid for the problem where we have partners that were mistakenly created as banks. [We have a better fix in the works, too.]

Details

We don't currently persist any indicator of current role. We'll need to do that when a role is changed, and have the sign-in know to go to the current role.

Potential 'gotchas'

  • the current role is deactivated
  • there is no current role , but there are active roles (which will be the initial state)

Criteria for completion

  • [ ] When a user signs in, they sign in as their "current role" from when they last signed in.
  • [ ] The "gotchas" are handled
  • [ ] Tests for this behaviour

cielf avatar Jan 23 '23 15:01 cielf

I would like to take this one.

brodyf42 avatar Feb 07 '23 21:02 brodyf42

I'm sorry @brodyf42 -- I totally missed your comment. Are you still interested?

cielf avatar Mar 16 '23 22:03 cielf

@cielf, I can still take it on. I haven't really started working on it except doing some investigation into the application. This is my first time working in human-essentials.

brodyf42 avatar Mar 16 '23 22:03 brodyf42

It's yours then -- so far it only is impacting a handful of users, but it would be nice if they didn't have the extra step every time they log in that they do now.

cielf avatar Mar 16 '23 22:03 cielf

This issue has been inactive for 242 hours (10.08 days) and will be automatically unassigned after 118 more hours (4.92 days).

github-actions[bot] avatar Mar 27 '23 00:03 github-actions[bot]

@cielf I am sorry, but some circumstances have changed, and I won't be able to work on this issue in the near future. Please feel free to unassign me.

brodyf42 avatar Mar 31 '23 21:03 brodyf42

@brodyf42 Not a problem. Hope they are happy circumstances.

cielf avatar Apr 01 '23 21:04 cielf

Hi @cielf, can I grab this?

patrickarnett avatar Apr 19 '23 03:04 patrickarnett

@patrickarnett Assigning it to you!

cielf avatar Apr 20 '23 21:04 cielf

This issue has been inactive for 243 hours (10.13 days) and will be automatically unassigned after 117 more hours (4.88 days).

github-actions[bot] avatar May 01 '23 00:05 github-actions[bot]

This issue has been inactive for 363 hours (15.13 days) and is past the limit of 360 hours (15.00 days) so is being unassigned.

github-actions[bot] avatar May 06 '23 00:05 github-actions[bot]

@patrickarnett made a PR at https://github.com/rubyforgood/human-essentials/pull/3564, but it didn't quite get to the heart of this. Whomever (including Patrick) picks this up next, please refer to the conversation in that PR for some adjustments to the approach -- namely, adding last_role_id onto users, reading that for setting the role on a new session, and writing to it when the role is changed.

awwaiid avatar Nov 12 '23 04:11 awwaiid

Hi I'd like to take this on.

vincent-truong-dev avatar Apr 07 '24 03:04 vincent-truong-dev

Hey @vincent-truong-dev It turns out we have a pull request in flight on this one! Please find another issue. Thank you.

cielf avatar Apr 07 '24 17:04 cielf