Skip to content
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

chore: rework the useAuth hook #126

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

chore: rework the useAuth hook #126

wants to merge 3 commits into from

Conversation

kayra1
Copy link
Contributor

@kayra1 kayra1 commented Nov 25, 2024

Description

This change reworks the useAuth hook so that the rest of the application does not have to use cookies directly. This means that all user login and logout functionality can be used through the useAuth hook. This includes logging in, logging out, initializing first user and checking if the first user is initialized. It also includes caching function definitions and disables queries right up until when the cookie loads into the browser, so it should feel much snappier to use the application.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that validate the behaviour of the software
  • I validated that new and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@kayra1 kayra1 marked this pull request as ready for review November 26, 2024 07:38
@kayra1 kayra1 requested a review from a team as a code owner November 26, 2024 07:38
Copy link
Collaborator

@gruyaume gruyaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels snappy indeed!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am (sometimes) getting this error after clicking logout. It seems to happen when I'm on the "Users" page when logging out.

image

Logs

NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at 354-6e0ed2af89a87bf1.js:1:289289
    at oP (4bd1b696-d2e2b461159d0368.js:1:81871)
    at ir (4bd1b696-d2e2b461159d0368.js:1:100512)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99775)
    at it (4bd1b696-d2e2b461159d0368.js:1:99907)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99907)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99907)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99907)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99907)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99907)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99907)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at ie (4bd1b696-d2e2b461159d0368.js:1:99837)
    at it (4bd1b696-d2e2b461159d0368.js:1:99973)
    at uf (4bd1b696-d2e2b461159d0368.js:1:124786)
    at o (4bd1b696-d2e2b461159d0368.js:1:120959)
    at MessagePort.T (517-f5f5803271fec325.js:1:107437)

Copy link
Contributor Author

@kayra1 kayra1 Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is weird, it only happens when the table in either page has more than 0 items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants