Hi! I need some help when implementing the setting...
# talk-kratos
e
Hi! I need some help when implementing the settings flow for a react client side SPA. I am having troubles with the succession of api calls and the redirects when the session is no longer valid when updating privileged fields. 1. I am calling self-service/settings/browser 2. I use the return value to get the flow id and the csrf token 3. I call /self-service/settings with the flow id, the csrf token and a NEW PASSWORD 4. I receive error session_refresh_required with a redirect_browser_to url 5. I redirect to the specified url /self-service/login/browser which contains query params for refresh=true and a return_to url that is /self-service/settings 6. I log in with the user's credentials with refresh true 7. I call the /self-service/settings 8. The PASSWORD doesn't seem to be updated I am probably doing something wrong?
The flow that I am trying to implement is what can be seen in this video: https://www.ory.sh/docs/assets/medias/browser-privileged-update-1f0a8534724a1c3e63af722453ea483e.webm
Pinging @magnificent-energy-493 and @steep-lamp-91158 as requested. How can we update privileged fields when the session is outdated. Client side SPA.
s
the change is only persisted for privileged sessions, so the new password has to be stored after the login with
refresh=true
we want to add a field to the
whoami
response that indicates whether the session is privileged
or a timestamp until when it is privileged
but that way you can determine BEFORE submitting the new password whether the
refresh=true
flow has to be done, and trigger it on your side
e
I think I understand better. So currently the user has to live with the UX that he/she has to submit the new password twice: Once to initiate and a second time after refreshing the session.
The video was giving the impression that the second submission would have been done automatically/in the background.
Is there an open github issue about adding the privileged: true key/value pair to
whoami
so that I could track the progress?
s
We had a private one, so I created https://github.com/ory/kratos/issues/2633