ghayma_auth 0.1.0
ghayma_auth: ^0.1.0 copied to clipboard
Client for the Ghayma auth service: sign-in, sessions, 2FA, PKCE OAuth and native Google sign-in for Dart and Flutter apps.
Changelog #
0.1.0 #
Initial release — a pure-Dart client for the Ghayma auth service, mirroring
@ghayma/sdk/client 1.2.0.
- Email and password:
register,login,forgotPassword,resetPassword,verifyResetToken,resendVerification.registerandloginreturn sealed results, so the pending-verification and pending-2FA shapes are part of the type rather than a runtime surprise. - Sessions:
init,getAccessToken,refreshwith token rotation,logout,currentSession/currentUser/isAuthenticated, and anonAuthStateChangestream. Refresh runs automatically 60 s before expiry and on demand within 30 s of it; a rejected refresh clears the session and emitssignedOut. - Two-factor:
verify2fa,enrollTotp,confirmTotp,regenerateRecoveryCodes,disable2fa, including the enforced-enrolment path that completes a login. - Profile:
getUser,updateUser,deleteAccount,changePassword,changeEmail,cancelEmailChange. - OAuth, PKCE only:
oauthUrl,startOAuth,handleRedirect,exchangeCode, andsignInWithIdTokenfor native Google sign-in. No implicit/fragment flow, so no token passes through the OS URL handler. - Persistence through a
TokenStorageseam with an in-memory default, so a Flutter app can drop in secure storage without the package depending on Flutter. - Server callers can pass a
serverKeyand per-callRequestOptions(clientIp)so rate limits are charged to the end user's address. - Contract-conformance tested: every method runs against a Prism mock of the published OpenAPI contract, in addition to the unit suite.