Skip to content

Commit

Permalink
Add support for organizationId parameter when signing in or refresh…
Browse files Browse the repository at this point in the history
…ing session (#73)

* Add `prettier`

* Update to `@workos-inc/[email protected]`

* Add `organizationId` to `getSignInUrl`

* Include current `organizationId` when refreshing

* Add `refreshSession` helper

* Use latest `@workos-inc/node`

* Add some notes about `refreshSession` to the README

* Tweak wording in README

Co-authored-by: Paul Asjes <[email protected]>

---------

Co-authored-by: Paul Asjes <[email protected]>
  • Loading branch information
mthadley and Paul Asjes authored Aug 6, 2024
1 parent 808cb0f commit 2e0b129
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 45 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ export default async function HomePage() {
}
```
### Refreshing the session
Use the `refreshSession` method in a server action or route handler to fetch the latest session details, including any changes to the user's roles or permissions.
The `organizationId` parameter can be passed to `refreshSession` in order to switch the session to a different organization. If the current session is not authorized for the next organization, an appropriate [authentication error](https://workos.com/docs/reference/user-management/authentication-errors) will be returned.
### Debugging
To enable debug logs, initialize the middleware with the debug flag enabled.
Expand Down
Loading

0 comments on commit 2e0b129

Please sign in to comment.