-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat!: react-query
and supplementary improvements
#147
Conversation
The main motivation being that with pnpm packages in the monorepo don't have to specify versions of the dependencies of other packages in the monorepo. It is also widely adopted across different monorepos. As well as `changesets` would replace the `workspace:*` marked versions on fly, so there won't be a need in managing those by hands (if there was one before). Fixes the lint issue, where in `with-next-auth` example a lint config was not properly set up, which caused the `lint` job to hang up waiting for stdin input. Adds a `turbo.json` config to `auth-kit` to depend on `auth-client`, as the build job for the first depends on the latter.
auth-monorepo/packages/auth-client/src/clients/transports/http.ts Lines 87 to 89 in b5ad5ec
This code seems incorrect as the |
Moved the `Date.now()` to `now` variable to ensure the timestamp at which the polling started is preserved correctly.
auth-monorepo/packages/auth-client/src/actions/app/watchStatus.ts Lines 19 to 31 in b5ad5ec
I believe this is a bit misleading, as we don't watch the status change here. In fact, the I'm considering to refactor this as well. |
auth-monorepo/packages/auth-client/src/messages/verify.ts Lines 54 to 68 in b5ad5ec
Those methods should not return any value as they don't mutate it. Same concern addressed in |
Crap, just realized this is intended. Will undo in next commit. |
It is a breaking change, since the hook APIs also change. However, everything is much more reliable now, and effects are not triggered when they don't have to. The context was changed to simply hold the `config`, which one has now to initiate with `createConfig`, in order to construct an `appClient`. The rest of the state now is handled by `zustand`, specifically, the `useProfile` and `useSignInMessage` use it.
react-query
and supplementary improvementsreact-query
and supplementary improvements
if ( | ||
signInError instanceof AuthClientError && | ||
signInError.errCode === "unavailable" && | ||
signInError.message.startsWith("Polling timed out after") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be a specific errCode
[signIn] | ||
); | ||
const handleSuccess = useCallback((res: CompletedStatusAPIResponse) => { | ||
console.log(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(res); |
I'm thinking about the implementation of I believe it is a similar state management question as Thus, I believe that For the What has to be persisted though is something like a session token, optimistically with a certain deadline. The current problem is that AFAIK the profile data is retrieved only from the What I believe should be done instead is that With those changes applied, hooks for client data retrieval (optimistically cc @horsefacts |
TODO: Refactor use profile and use sign in message hooks.
|
I don't think we want the relays to become general purpose auth servers. Session tokens, and their persistence and expiry should be up to the developer and the auth setup they're using. |
Yep! I figured it out a bit later and need to rename some things now. |
I introduced changes to routes, data types and now I'm reverting it back
Reimplemented 1265f28.
I dropped e2e test in the merge conflict on purpose. tbh a bit lazy to rewrite it right now, that effort has to be put later on. |
pipelines fail because I've changed the package manager. |
tbh I have some questions regarding the dalechyn@62874a0 but we can think of this later if we want this pr to ever make it lul. |
gonna separate the efforts in this fork: https://github.com/dalechyn/fc-auth, since the changes are too massive to be merged. |
Will close #146