You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(auth): handle invitation with managed auth (NangoHQ#2535)
## Describe your changes
Fixes
https://linear.app/nango/issue/NAN-1479/fix-managed-auth-with-org-should-clear-invitation
Fixes
https://linear.app/nango/issue/NAN-1478/fix-invitation-to-an-existing-account-doesnt-work-in-managed-auth
Fixes
https://linear.app/nango/issue/NAN-1477/fix-invitation-with-managed-auth-doesnt-work-anymore
After refactoring invitation, one path was broken. When debugging I
found other issues. I also took the time to refactor the endpoints too.
### Major Changes
- Managed auth endpoint dedicated file
Note there was two endpoint to handle getting a URL to use Google wether
you had a invitation or not, it's not a single endpoint.
- Fix: correctly pass invitation token to Google Auth
- Fix: when you invite an account that log with Google, it now correctly
accepts invitation
- Fix: when you log with Google, it now correctly clear pending
invitations if any
- Fix: when you invite an account that log with Google that already
exists, it now correctly accepts invitation
### Minor changes
- `GET /meta` dedicated file
I initially wanted to sync feature flag with this endpoint, but it's a
call that require a session. In the end I didn't modified the endpoint,
except the response object that now doesn't return email (which was
already returned by `/user`)
- You can now enable or disable auth via process.env
- Fix: user serialization was passing `accountId` instead of
`account_id`, I messed up in a previous PR
## 🧪 How to test?
- Add `WORKOS_CLIENT_ID` and `WORKOS_API_KEY` to your `.env`
- Add `FLAG_AUTH_ENABLED=true` `FLAG_MANAGED_AUTH_ENABLED=true` to your
`.env`
- Log out if you are currently logged in with the default account
- Try signin and signup
- Delete your account in database
- Try inviting this account
- Go to `/signup/__TOKEN__` and use this invite with Google auth
0 commit comments