workos / authkit-js

Vanilla JS AuthKit SDK
MIT License
9 stars 3 forks source link

RefreshSession / Org Change #48

Closed esko22 closed 2 weeks ago

esko22 commented 2 weeks ago

Howdy -

I'm using authkit-react: 0.5.1 >> authkit-js: 0.5 and attempting to build an organization toggle.

Not sure if I am going about this the proper way but, my digging led me trying to call refreshSession(organizationId) on the client from the useAuth hook. However it is no longer exported via #27

Is there another way I should be changing the organization_id for the session?

Thanks

PaulAsjes commented 2 weeks ago

Hey there, we're looking into this and will get back to you shortly!

geoffsoftledger commented 2 weeks ago

We're having the same trouble here - looks like all we can do is force the user to logout/login right now.

cmatheson commented 2 weeks ago

There is a new switchToOrganization method on the client that can be used to switch orgs (this has also been exported to authkit-react's useAuth hook. let us know if you run into any issues with it.

esko22 commented 2 weeks ago

Works perfect - thank you.