Skip to content

Credentials aren't refreshed after switching to a different user account #10008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Pwuts opened this issue May 22, 2025 — with Linear · 0 comments
Closed

Credentials aren't refreshed after switching to a different user account #10008

Pwuts opened this issue May 22, 2025 — with Linear · 0 comments
Assignees
Labels
platform/frontend AutoGPT Platform - Front end

Comments

Copy link
Member

Pwuts commented May 22, 2025

When you switch from one account to another and go to e.g. the builder, it doesn't load the credentials of the account you switched to.

@Pwuts Pwuts self-assigned this May 22, 2025
@Pwuts Pwuts added the platform/frontend AutoGPT Platform - Front end label May 22, 2025 — with Linear
github-merge-queue bot pushed a commit that referenced this issue Jun 4, 2025
…state change (#10017)

- Resolves #10008

### Changes 🏗️

- Update `useSupabase` hook to propagate auth state changes
- Refresh `CredentialsProvider` whenever the user login state changes
- Add `logOut` callback to `useSupabase` hook that handles (client-side)
logout
- Remove server-side `logout` action: the Supabase reference
implementation does it client-side, and doing both causes a race
condition

Refactorings to aid implementation of the above:
- Move `@/hooks/useSupabase` -> `@/lib/supabase/useSupabase`

Other improvements:
- Clean up `login` server action based on reference implementation
- Make `BackendAPI.isAuthenticated()` more efficient and faster
- Remove unused `ProfileDropdown` component
- Improve logic and debug logging in `tests/pages/login.page.ts`
- Improve playwright test output logging

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  - Log out from account (A)
  - Log in to other account (B)
- Open builder, add a block for which account B has (multiple)
credentials
  - [x] Credentials for account B are shown
  - [x] Credentials for account A are *not* shown

  **Note: do not reload the page** while going through these steps
@Pwuts Pwuts closed this as completed Jun 4, 2025
@github-project-automation github-project-automation bot moved this to Done in Frontend Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/frontend AutoGPT Platform - Front end
Projects
Status: Done
Development

No branches or pull requests

1 participant