dartvex_auth_better 0.2.0
dartvex_auth_better: ^0.2.0 copied to clipboard
Better Auth adapter for Dartvex. Self-hosted authentication for Convex with Better Auth.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased] #
0.2.0 - 2026-06-12 #
Added #
ConvexBetterAuthProvideraccepts aninitialSessionTokenso a session token persisted from a previous run can be restored across process restarts vialoginFromCache(). Previously the provider had no public way to seed the persisted token, so the documented persistence flow could not drive the provider-basedwithAuthrestore.
Fixed #
BetterAuthClient.getSession()now treats 401/403 as an expired or absent session while preserving non-auth HTTP failures as typed Better Auth exceptions, so transient 5xx responses are not collapsed into "no session".BetterAuthClient.forgotPassword()now calls Better Auth's official/request-password-resetendpoint instead of the obsolete/forget-passwordpath.BetterAuthClientnow preserves transient/api/auth/convex/tokenHTTP failures as retryable Better Auth exceptions instead of collapsing them into expired-session errors.- Convert malformed 200 sign-in, sign-up, get-session, and magic-link response bodies into typed Better Auth errors instead of raw cast or decode exceptions.
- Guard the nested
user/sessionfields of a 200 response: a non-object value now surfaces as a null session (or empty user fields) instead of a rawTypeError. - Guard malformed nested Better Auth user scalar fields so non-string
id,email, ornamevalues do not throw raw cast errors. - Convert malformed Convex token endpoint responses into typed session-expired errors instead of raw cast or decode exceptions.
- Clarify missing session-token errors with Flutter web CORS guidance and document that cookie fallback is native-only.
- Do not reject successful 200 Better Auth responses merely because they
include informational
messageorerrorfields. ConvexBetterAuthProvider.login()now reuses the session created bysignUp()when the credentials still match, avoiding an unnecessary duplicate sign-in request after account creation.ConvexBetterAuthProvider.logout()now clears cached session state even if the Better Auth sign-out request fails.- Removes diagnostic prints that could expose Better Auth URLs, headers, cookies, request bodies, or tokens.
Changed #
- Require
dartvex^0.2.0. BetterAuthClientnow constructs its default HTTP client through the core'screateDefaultHttpClient(), so auth requests share the platform transport installed bydartvex_flutter(NSURLSession on iOS/macOS). An explicitly providedhttpClientbehaves exactly as before.
0.1.3 - 2026-04-30 #
Improved #
- Refreshed README metadata, logo links, installation snippets, and package example code for pub.dev.
0.1.2 - 2026-03-21 #
Improved #
- Added comprehensive dartdoc comments on all public API
- Added example file for pub.dev scoring