capacitor-auth-manager 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +180 -0
- package/CapacitorAuthManager.podspec +10 -18
- package/LICENSE +1 -1
- package/Readme.md +136 -595
- package/android/build.gradle +14 -18
- package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/CapacitorAuthManager.java +44 -16
- package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/CapacitorAuthManagerPlugin.java +24 -3
- package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/GoogleAuthProvider.java +424 -226
- package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/ProviderFactory.java +27 -99
- package/dist/angular.cjs.js +942 -4545
- package/dist/core.cjs.js +913 -4515
- package/dist/esm/angular/auth.guard.js +0 -1
- package/dist/esm/angular/auth.module.js +0 -1
- package/dist/esm/angular/auth.service.js +0 -1
- package/dist/esm/angular/index.d.ts +1 -0
- package/dist/esm/angular/index.js +4 -1
- package/dist/esm/capacitor-plugin.js +0 -1
- package/dist/esm/core/auth-manager.d.ts +6 -0
- package/dist/esm/core/auth-manager.js +25 -4
- package/dist/esm/core/index.js +0 -1
- package/dist/esm/core/platform.js +0 -1
- package/dist/esm/core/provider-manifests.js +0 -1
- package/dist/esm/core/provider-registry.d.ts +7 -0
- package/dist/esm/core/provider-registry.js +55 -53
- package/dist/esm/core/types.js +0 -1
- package/dist/esm/definitions.d.ts +30 -1
- package/dist/esm/definitions.js +8 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/providers/base-provider.js +0 -1
- package/dist/esm/providers/native/google-native-provider.d.ts +26 -0
- package/dist/esm/providers/native/google-native-provider.js +114 -0
- package/dist/esm/providers/oauth-provider.js +0 -1
- package/dist/esm/providers/provider-factory.d.ts +9 -0
- package/dist/esm/providers/provider-factory.js +20 -57
- package/dist/esm/providers/web/google-provider.d.ts +70 -92
- package/dist/esm/providers/web/google-provider.js +262 -205
- package/dist/esm/providers/web/index.d.ts +0 -14
- package/dist/esm/providers/web/index.js +7 -16
- package/dist/esm/react/hooks.js +0 -1
- package/dist/esm/react/index.d.ts +1 -0
- package/dist/esm/react/index.js +4 -1
- package/dist/esm/react/types.js +0 -1
- package/dist/esm/utils/auth-error.js +0 -1
- package/dist/esm/utils/error-message.js +0 -1
- package/dist/esm/utils/event-emitter.js +0 -1
- package/dist/esm/utils/logger.js +0 -1
- package/dist/esm/utils/pending-verification-store.js +0 -1
- package/dist/esm/utils/storage.js +0 -1
- package/dist/esm/vue/composables.js +0 -1
- package/dist/esm/vue/index.d.ts +1 -0
- package/dist/esm/vue/index.js +4 -1
- package/dist/esm/web.js +0 -1
- package/dist/plugin.cjs.js +435 -4664
- package/dist/plugin.js +435 -4664
- package/dist/react.cjs.js +942 -4545
- package/dist/vue.cjs.js +942 -4545
- package/ios/Plugin/CapacitorAuthManager.swift +12 -21
- package/ios/Plugin/GoogleAuthProvider.swift +213 -105
- package/ios/Plugin/Models.swift +35 -4
- package/ios/Plugin/Plugin.swift +4 -2
- package/package.json +31 -30
- package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/FacebookAuthProvider.java +0 -389
- package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/MicrosoftAuthProvider.java +0 -455
- package/dist/angular.cjs.js.map +0 -1
- package/dist/core.cjs.js.map +0 -1
- package/dist/esm/angular/auth.guard.js.map +0 -1
- package/dist/esm/angular/auth.module.js.map +0 -1
- package/dist/esm/angular/auth.service.js.map +0 -1
- package/dist/esm/angular/index.js.map +0 -1
- package/dist/esm/capacitor-plugin.js.map +0 -1
- package/dist/esm/core/auth-manager.js.map +0 -1
- package/dist/esm/core/index.js.map +0 -1
- package/dist/esm/core/platform.js.map +0 -1
- package/dist/esm/core/provider-manifests.js.map +0 -1
- package/dist/esm/core/provider-registry.js.map +0 -1
- package/dist/esm/core/types.js.map +0 -1
- package/dist/esm/definitions.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/providers/base-provider.js.map +0 -1
- package/dist/esm/providers/oauth-provider.js.map +0 -1
- package/dist/esm/providers/provider-factory.js.map +0 -1
- package/dist/esm/providers/web/apple-provider.d.ts +0 -61
- package/dist/esm/providers/web/apple-provider.js +0 -293
- package/dist/esm/providers/web/apple-provider.js.map +0 -1
- package/dist/esm/providers/web/biometric-provider.d.ts +0 -60
- package/dist/esm/providers/web/biometric-provider.js +0 -374
- package/dist/esm/providers/web/biometric-provider.js.map +0 -1
- package/dist/esm/providers/web/email-code-provider.d.ts +0 -46
- package/dist/esm/providers/web/email-code-provider.js +0 -294
- package/dist/esm/providers/web/email-code-provider.js.map +0 -1
- package/dist/esm/providers/web/email-password-provider.d.ts +0 -52
- package/dist/esm/providers/web/email-password-provider.js +0 -430
- package/dist/esm/providers/web/email-password-provider.js.map +0 -1
- package/dist/esm/providers/web/facebook-provider.d.ts +0 -80
- package/dist/esm/providers/web/facebook-provider.js +0 -249
- package/dist/esm/providers/web/facebook-provider.js.map +0 -1
- package/dist/esm/providers/web/firebase-provider.d.ts +0 -22
- package/dist/esm/providers/web/firebase-provider.js +0 -338
- package/dist/esm/providers/web/firebase-provider.js.map +0 -1
- package/dist/esm/providers/web/github-provider.d.ts +0 -34
- package/dist/esm/providers/web/github-provider.js +0 -325
- package/dist/esm/providers/web/github-provider.js.map +0 -1
- package/dist/esm/providers/web/google-provider.js.map +0 -1
- package/dist/esm/providers/web/index.js.map +0 -1
- package/dist/esm/providers/web/linkedin-provider.d.ts +0 -37
- package/dist/esm/providers/web/linkedin-provider.js +0 -178
- package/dist/esm/providers/web/linkedin-provider.js.map +0 -1
- package/dist/esm/providers/web/magic-link-provider.d.ts +0 -44
- package/dist/esm/providers/web/magic-link-provider.js +0 -311
- package/dist/esm/providers/web/magic-link-provider.js.map +0 -1
- package/dist/esm/providers/web/microsoft-provider.d.ts +0 -23
- package/dist/esm/providers/web/microsoft-provider.js +0 -236
- package/dist/esm/providers/web/microsoft-provider.js.map +0 -1
- package/dist/esm/providers/web/phone-password-provider.d.ts +0 -63
- package/dist/esm/providers/web/phone-password-provider.js +0 -442
- package/dist/esm/providers/web/phone-password-provider.js.map +0 -1
- package/dist/esm/providers/web/slack-provider.d.ts +0 -39
- package/dist/esm/providers/web/slack-provider.js +0 -175
- package/dist/esm/providers/web/slack-provider.js.map +0 -1
- package/dist/esm/providers/web/sms-provider.d.ts +0 -46
- package/dist/esm/providers/web/sms-provider.js +0 -306
- package/dist/esm/providers/web/sms-provider.js.map +0 -1
- package/dist/esm/providers/web/username-password-provider.d.ts +0 -59
- package/dist/esm/providers/web/username-password-provider.js +0 -435
- package/dist/esm/providers/web/username-password-provider.js.map +0 -1
- package/dist/esm/react/hooks.js.map +0 -1
- package/dist/esm/react/index.js.map +0 -1
- package/dist/esm/react/types.js.map +0 -1
- package/dist/esm/utils/auth-error.js.map +0 -1
- package/dist/esm/utils/error-message.js.map +0 -1
- package/dist/esm/utils/event-emitter.js.map +0 -1
- package/dist/esm/utils/logger.js.map +0 -1
- package/dist/esm/utils/pending-verification-store.js.map +0 -1
- package/dist/esm/utils/storage.js.map +0 -1
- package/dist/esm/vue/composables.js.map +0 -1
- package/dist/esm/vue/index.js.map +0 -1
- package/dist/esm/web.js.map +0 -1
- package/dist/plugin.cjs.js.map +0 -1
- package/dist/plugin.js.map +0 -1
- package/dist/react.cjs.js.map +0 -1
- package/dist/vue.cjs.js.map +0 -1
- package/ios/Plugin/AppleAuthProvider.swift +0 -288
- package/ios/Plugin/FacebookAuthProvider.swift +0 -297
- package/ios/Plugin/GitHubAuthProvider.swift +0 -54
- package/ios/Plugin/LinkedInAuthProvider.swift +0 -63
- package/ios/Plugin/MicrosoftAuthProvider.swift +0 -315
- package/ios/Plugin/OAuthWebProvider.swift +0 -415
- package/ios/Plugin/SlackAuthProvider.swift +0 -108
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `capacitor-auth-manager` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.4.2] — 2026-06-30
|
|
9
|
+
|
|
10
|
+
**Native now actually compiles — Google-only native (verified).** `2.4.1` shipped native sources that
|
|
11
|
+
had never been built in a real app; an end-to-end integration compile (a throwaway Capacitor app, real
|
|
12
|
+
Android `gradle assembleDebug` + iOS `pod lib lint`) surfaced and fixed the breakage. **Use `2.4.2`, not
|
|
13
|
+
`2.4.1`** (which is deprecated).
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Native is Google-only.** Removed the Facebook (`FBSDKLoginKit` / `facebook-login`) and Microsoft
|
|
18
|
+
(`MSAL`) native dependencies so the plugin no longer drags heavy auth SDKs into every consumer app. The
|
|
19
|
+
disabled providers' native code moved to `android/disabled-native-providers/` and
|
|
20
|
+
`ios/disabled-native-providers/` (kept for re-enablement; not compiled, not shipped). `ProviderFactory`
|
|
21
|
+
(Android) and `createProvider` (iOS) are trimmed to Google; the JS layer already reports
|
|
22
|
+
`PROVIDER_NOT_ENABLED` for the rest.
|
|
23
|
+
- iOS podspec slimmed to `Capacitor` + `GoogleSignIn ~> 7.1`; removed the dangling
|
|
24
|
+
`SWIFT_OBJC_BRIDGING_HEADER` (the file never existed; GoogleSignIn 7 is pure Swift).
|
|
25
|
+
|
|
26
|
+
### Fixed (native compile errors that blocked every consumer build)
|
|
27
|
+
|
|
28
|
+
- **Android:** `com.facebook.android:facebook-login:17.0.3` was unresolvable → build failed before any
|
|
29
|
+
Java compiled. `GoogleAuthProvider` caught `GoogleIdTokenParsingException`, a checked exception
|
|
30
|
+
`GoogleIdTokenCredential.createFrom` doesn't declare in googleid 1.1.1. `getIdToken` called the throwing
|
|
31
|
+
`JSObject.getBoolean(...)` unguarded → unreported `JSONException`. Verified with `gradle :…:assembleDebug`.
|
|
32
|
+
- **iOS:** `CapacitorAuthManager` passed `AuthPersistence` / `AuthProvider` enums where the storage API
|
|
33
|
+
expects `String` (`.rawValue`). `Plugin.removeAllListeners(_:)` now `override public`s Capacitor 8's
|
|
34
|
+
built-in and delegates to `super`. Verified with `pod lib lint`.
|
|
35
|
+
|
|
36
|
+
> Both platforms now build in a clean Capacitor 8 app. Still verify Google sign-in on a real device before
|
|
37
|
+
> the fleet rollout (a successful compile is not a runtime test).
|
|
38
|
+
|
|
39
|
+
## [2.4.1] — 2026-06-30
|
|
40
|
+
|
|
41
|
+
**Google-first production refocus.** This release turns the package into a working, **Firebase-agnostic
|
|
42
|
+
Google authentication plugin** across **web, iOS and Android** — a drop-in alternative to
|
|
43
|
+
`@codetrix-studio/capacitor-google-auth`. The remaining providers are being re-enabled **one at a time**
|
|
44
|
+
as each is hardened and verified on device; until then they report a clear `PROVIDER_NOT_ENABLED` error.
|
|
45
|
+
|
|
46
|
+
> **Versioning note:** by maintainer choice this is a **patch**. Future providers land as **minor** bumps,
|
|
47
|
+
> fixes as patches, and a `3.0.0` only once all providers are working again. If your app used a non-Google
|
|
48
|
+
> provider on `2.4.0`, stay on `2.4.0` until that provider is re-enabled.
|
|
49
|
+
|
|
50
|
+
> **Native build caveat:** the iOS (Swift) and Android (Java) sources in this release were written to the
|
|
51
|
+
> official SDK contracts but are **not compiled in CI**. Validate `2.4.1` in **one** app (web + one Android
|
|
52
|
+
> device + one iOS device) before rolling it out to a fleet.
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
56
|
+
- **Native dispatch.** `auth.signIn(AuthProvider.GOOGLE)` (and the React/Vue/Angular `useAuth().signIn`)
|
|
57
|
+
now route to the **native Google SDK on iOS/Android** and to **Google Identity Services on web** — the
|
|
58
|
+
same call on every platform. Previously the modern API always ran the web flow, even inside a device webview.
|
|
59
|
+
- **`GoogleNativeProvider`** — a platform-bridge provider that delegates to the `CapacitorAuthManager`
|
|
60
|
+
Capacitor plugin (native Google SDK) and returns `{ idToken, accessToken?, serverAuthCode?, user }`.
|
|
61
|
+
- **Android Google rebuilt on Credential Manager** (`androidx.credentials` + `GoogleIdTokenCredential`),
|
|
62
|
+
replacing the deprecated, broken `GoogleSignIn` activity-result path (which never resolved).
|
|
63
|
+
- **Web Google rebuilt on the GIS id-token flow** (`google.accounts.id`) — no client secret, no backend;
|
|
64
|
+
returns a Google `idToken` you can feed to `signInWithCredential(GoogleAuthProvider.credential(idToken))`.
|
|
65
|
+
- `AuthCredential.serverAuthCode`, `GoogleAuthOptions.iosClientId` / `filterByAuthorizedAccounts` /
|
|
66
|
+
`autoSelectEnabled` / `nonce`, and `AuthErrorCode.PROVIDER_NOT_ENABLED`.
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
|
|
70
|
+
- **Only Google is enabled.** The other 14 providers are un-registered and excluded from the published
|
|
71
|
+
build; their web implementations remain in the repo for re-enablement. `signIn()` for any of them throws
|
|
72
|
+
`AuthErrorCode.PROVIDER_NOT_ENABLED` with a clear message.
|
|
73
|
+
- **No secrets persisted by default.** The manager no longer writes `idToken` / `accessToken` /
|
|
74
|
+
`refreshToken` / `serverAuthCode` to the default (unencrypted) storage — only a non-secret session
|
|
75
|
+
snapshot. Short-lived tokens are re-derived via the provider's silent restore. Inject a secure storage
|
|
76
|
+
adapter if you want token persistence.
|
|
77
|
+
- **Packaging:** `prepack` now builds `dist/` (so `npm pack` produces an importable tarball, not just
|
|
78
|
+
`npm publish`); `prepublishOnly` runs build + lint; added `engines.node >=18`; `@angular/core` peer range
|
|
79
|
+
widened to include `^22`; `CHANGELOG.md` now ships; added `./package.json` export; LICENSE copyright
|
|
80
|
+
updated to 2024–2026.
|
|
81
|
+
|
|
82
|
+
### Fixed
|
|
83
|
+
|
|
84
|
+
- iOS Google: `emailVerified` was wrongly derived from the profile image; replaced the deprecated
|
|
85
|
+
`UIApplication.shared.windows` presenter lookup.
|
|
86
|
+
- Web Google: removed the insecure client-side OAuth code→token exchange that required a `client_secret`
|
|
87
|
+
in the browser.
|
|
88
|
+
|
|
89
|
+
## [2.4.0] — 2026-05-27
|
|
90
|
+
|
|
91
|
+
**No runtime behavior change.** Type-safety and tooling cleanup. Public types were tightened (see below), so TypeScript consumers may surface new, helpful type errors — hence a minor (not patch) bump. No public method was removed or renamed.
|
|
92
|
+
|
|
93
|
+
### Changed (type safety)
|
|
94
|
+
|
|
95
|
+
- Eliminated **all 37 remaining `no-explicit-any`** occurrences — the linter now reports **0 errors and 0 warnings**.
|
|
96
|
+
- **`StorageInterface` is now generic**: `get<T = unknown>(key): Promise<T | null>` and `set<T = unknown>(key, value: T)` (was `Promise<any>` / `value: any`). Existing custom-storage implementations remain compatible; direct callers now get `unknown` by default and should pass a type argument (`storage.get<AuthUser>(key)`) or narrow.
|
|
97
|
+
- **Angular adapter** method parameters now use real types instead of `any`: `configure(config: AuthManagerConfig)`, `initialize(config?)`, `signIn(options?)`, `signOut(options?: SignOutOptions)`, and `AuthModuleConfig.providers: Record<string, ProviderOptions>`.
|
|
98
|
+
- `catch (error: any)` blocks across the credential/biometric/registry providers now use a shared `getErrorMessage(error: unknown)` helper (`src/utils/error-message.ts`).
|
|
99
|
+
- `provider-registry` loader types and `platform` checks narrowed from `any` to precise types; `phone-password` backend payload and `biometric` credential params are now typed.
|
|
100
|
+
- Genuinely dynamic boundaries (optional-peer-dependency dynamic imports of `@capacitor/preferences` and `capacitor-biometric-authentication`) retain a single documented `// eslint-disable-next-line` instead of an undocumented `any`.
|
|
101
|
+
|
|
102
|
+
### Changed (tooling)
|
|
103
|
+
|
|
104
|
+
- Completed the ESLint 9→10 migration started in 2.2.0: renamed `eslint.config.js` → `eslint.config.mjs` and migrated the deprecated `.eslintignore` into the flat config's `ignores`. `npm run lint` output is now free of deprecation notices.
|
|
105
|
+
|
|
106
|
+
## [2.3.0] — 2026-05-26
|
|
107
|
+
|
|
108
|
+
**No breaking changes.** Backward-compatible minor release. This is an **internal refactor only** — no public method signature, runtime behavior, or provider list changed. There are still **15 web providers**.
|
|
109
|
+
|
|
110
|
+
### Internal
|
|
111
|
+
|
|
112
|
+
- Completed audit finding **F-39**: the 7 web providers that previously implemented `AuthProviderInterface` directly (`magic-link`, `sms`, `email-code`, `email-password`, `username-password`, `phone-password`, `biometric`) now extend the shared `BaseAuthProvider` — the same base used by the OAuth and Firebase providers. All **15** web providers now share one construction, event, state, and capability-detection path, removing the duplicated lifecycle/state machinery the audit flagged.
|
|
113
|
+
- Provider constructors accept **either** the injected `BaseProviderConfig` (factory/registry path) **or** the provider's own bare config object (direct construction), via a shared `resolveProviderConfig` helper. Existing `new XProvider(config)` usage from `capacitor-auth-manager/providers/web` keeps working unchanged.
|
|
114
|
+
- Per-provider `linkAccount`/`unlinkAccount` no-op throwers were removed in favor of `BaseAuthProvider`'s `OPERATION_NOT_ALLOWED` defaults (completing F-44). Provider-specific capability behavior is preserved (biometric `unlinkAccount` and magic-link/sms/email-code `revokeAccess` still clear their stored/pending state).
|
|
115
|
+
- Base capability-default error messages reworded to a consistent "… is not supported by provider …".
|
|
116
|
+
- `no-explicit-any` lint warnings reduced from 45 to 37.
|
|
117
|
+
|
|
118
|
+
### Verification
|
|
119
|
+
|
|
120
|
+
- `npm run build` clean · `npm run test:run` → 79 pass · `npm run lint` → 0 errors (37 warnings).
|
|
121
|
+
|
|
122
|
+
## [2.2.0] — 2026-05-26
|
|
123
|
+
|
|
124
|
+
**No breaking changes.** This is a backward-compatible minor release — no public method signature was removed or changed in a breaking way. It repairs broken runtime paths, hardens security, completes the stub providers, and updates dependencies. There are **15 web providers**: apple, biometric, email-code, email-password, facebook, firebase, github, google, linkedin, magic-link, microsoft, phone-password, slack, sms, username-password.
|
|
125
|
+
|
|
126
|
+
### Dependencies
|
|
127
|
+
|
|
128
|
+
- Updated all dependencies to current stable. Dev/build majors applied: `@types/node` 25, `eslint` 10, `typescript` 6, `@capacitor/*` 8, plus rollup, vitest, prettier, happy-dom, and others.
|
|
129
|
+
- Widened peer ranges so existing consumers are not broken:
|
|
130
|
+
- `@capacitor/core`: `^7.4.2 || ^8.0.0` (optional — only for the native plugin / `CapacitorPreferencesStorage`).
|
|
131
|
+
- `@angular/core`: extended through `^21.0.0`.
|
|
132
|
+
- `react` `16.8`–`19`, `vue` `^3` remain supported.
|
|
133
|
+
- `@capacitor/preferences` is an optional peer, required only for `CapacitorPreferencesStorage`.
|
|
134
|
+
- iOS podspec deployment target raised from 13.0 to 14.0.
|
|
135
|
+
|
|
136
|
+
### Security
|
|
137
|
+
|
|
138
|
+
- **PKCE (S256)** added to the authorization-code OAuth flow (manual flows — Slack, LinkedIn) per RFC 7636: a `code_verifier` is generated and persisted with `state`/`nonce`, and `code_challenge` + `code_challenge_method=S256` are sent on the authorization request. Default-on for those flows; respects `pkceEnabled`. (Google uses Google Identity Services and Apple uses its SDK — both manage PKCE themselves.)
|
|
139
|
+
- **OIDC nonce + ID-token `exp` validation.** The returned ID token's `nonce` is compared to the stored value (`auth/invalid-nonce` on mismatch) and the `exp` claim is checked. ID-token **signatures are not verified client-side** — consumers must re-validate ID tokens against the provider's JWKS server-side before trusting claims.
|
|
140
|
+
- **Pluggable secure storage.** `configure()` accepts a `storage` option (any `StorageInterface`). New exported `CapacitorPreferencesStorage` backs storage with `@capacitor/preferences` (native key-value) so native tokens stay out of the webview's `localStorage`. The default web storage remains `localStorage`, which is readable by any XSS/third-party script — documented honestly; inject secure storage on native. Capacitor Preferences is not hardware-encrypted; use a Keychain/Keystore-backed adapter for secrecy at rest.
|
|
141
|
+
- **Biometric web fallback now uses real AES-GCM** with a non-extractable IndexedDB key, replacing base64 encoding (existing base64 values remain decodable for compatibility).
|
|
142
|
+
- **`client_secret` deprecated for browser use.** Browser-facing `clientSecret`/`appSecret` fields are no longer read in browser token/refresh/revoke calls (a secret in the JS bundle is recoverable) and emit a one-time warning when supplied in a web context. Fields kept for backward compatibility.
|
|
143
|
+
- **`AuthError.details` is sanitized** — token/password keys are redacted and only JSON-safe primitives are retained.
|
|
144
|
+
- CSPRNG (`crypto.randomUUID` / `crypto.getRandomValues`) used for UID fallbacks; developer-supplied credential endpoints warn if non-HTTPS.
|
|
145
|
+
|
|
146
|
+
### Fixes
|
|
147
|
+
|
|
148
|
+
- **Primary `auth` API was broken at runtime for OAuth and credential providers** — the provider registry constructed `BaseAuthProvider` subclasses with raw options instead of a `BaseProviderConfig`, so storage/logger/options were `undefined`. The registry now builds a proper config and injects shared storage + logger. This repaired path is what the React/Vue/Angular adapters use.
|
|
149
|
+
- **Credential threading** — `auth.signIn({ provider, credentials })` now reaches credential providers correctly (credentials spread to where each provider reads them).
|
|
150
|
+
- **Provider name resolution** — underscore enum values (`username_password`, `email_code`, `phone_password`, `email_magic_link`) now resolve to the correct registry loaders; added missing loaders for `email-code` and `phone-password`.
|
|
151
|
+
- **Session restore** now runs after `configure()` supplies providers, so a persisted session is rehydrated on reload (previously the auto-init-in-constructor left it dead).
|
|
152
|
+
- **GitHub sign-in completes** via a developer-supplied `tokenExchangeProxy` (alias `tokenEndpoint`); the per-init `message` listener and popup interval no longer leak. Without a proxy, sign-in throws `auth/missing-config`.
|
|
153
|
+
- **Slack and LinkedIn fetch real user profiles** (Slack `openid.connect.userInfo`, LinkedIn `/v2/userinfo`) instead of returning hardcoded placeholder identities.
|
|
154
|
+
- **Firebase sign-in method** is derived from standard options/credentials, with a new `defaultMethod` fallback (previously branched on an undocumented field the manager never sent).
|
|
155
|
+
- **Microsoft** per-sign-in `scopes`/`loginHint`/`prompt` are mapped explicitly into the MSAL request.
|
|
156
|
+
- **Passwordless pending state** (SMS / email-code / magic-link) is persisted (non-secret metadata only) so verification survives reload/redirect.
|
|
157
|
+
- Auto-refresh timer no longer overflows the 32-bit `setTimeout` ceiling for far-future expiry; an untargeted `signOut` clears all refresh timers; `refreshToken` token access is null-guarded.
|
|
158
|
+
- `web.ts` `getIdToken` no longer double-parses already-parsed storage; `getCurrentUser` isolates per-provider failures and sets the current provider; Apple `refreshToken` returns `auth/operation-not-allowed`; SMS/email-code `refreshToken` return `auth/operation-not-allowed`.
|
|
159
|
+
- In-memory `persistence: 'memory'` now correctly maps to in-memory storage (previously fell through to `localStorage`).
|
|
160
|
+
|
|
161
|
+
### Features
|
|
162
|
+
|
|
163
|
+
- **Account-management methods on the `auth` singleton** (and surfaced through the React/Vue/Angular adapters): `linkAccount`, `unlinkAccount`, `revokeAccess`, `getIdToken`, `updateProfile`, `deleteAccount`. Each delegates to the active provider and throws `auth/operation-not-allowed` if unsupported.
|
|
164
|
+
- New `isProviderConfigured(name)` and `getConfiguredProviders()` accessors on the singleton (also used by the adapters instead of reaching into private state).
|
|
165
|
+
- New config field `GitHubAuthOptions.tokenExchangeProxy` (alias `tokenEndpoint`) and `FirebaseAuthOptions.defaultMethod`.
|
|
166
|
+
- New exports: `WebStorage`, `CapacitorPreferencesStorage`, `StorageInterface`, and the shared `defaultLogger` (plus `Logger`, `LogLevel`, `LoggerConfig`).
|
|
167
|
+
|
|
168
|
+
### Internal
|
|
169
|
+
|
|
170
|
+
- **Centralized logging.** All package logging routes through a `Logger`; zero direct `console.*` calls remain outside the logger module. Default level `warn`; adjustable via `VITE_LOG_LEVEL` / `LOG_LEVEL` (build-time) or `defaultLogger.setLevel()` (runtime). The logger deliberately does not patch the host's global `console` or read the host's `localStorage` (documented deviations appropriate for a published library).
|
|
171
|
+
- All standalone providers throw `AuthErrorCode` enum members instead of bare string codes; added additive enum members (e.g. `CREDENTIALS_REQUIRED`, `INVALID_CODE`, `CODE_EXPIRED`, `INVALID_TOKEN`, `STORAGE_ERROR`, `PROVIDER_UNSUPPORTED_OPERATION`).
|
|
172
|
+
- Typing: replaced `any` in exported public types with concrete types. One acknowledged widening to a precise type — `AuthManagerConfig.providers` is now `Record<string, ProviderOptions>` instead of `any`. Reduced SDK-boundary `any` (minimal interface shapes for Firebase/MSAL/Facebook/GitHub) and internal mapper typing (lint `no-explicit-any` warnings 138 → 45).
|
|
173
|
+
- Extracted provider manifest data into `provider-manifests.ts` (registry file 752 → 281 lines).
|
|
174
|
+
- tsconfig `moduleResolution` `node10` → `bundler`, `module` `ES2020` → `ESNext`, added `rootDir`; ESLint consolidated onto unified `typescript-eslint` (dropped the banned `@eslint/js`).
|
|
175
|
+
|
|
176
|
+
### Verification
|
|
177
|
+
|
|
178
|
+
- `npm run build` succeeds; `npm run test:run` — 79 tests pass; `npm run lint` — 0 errors.
|
|
179
|
+
|
|
180
|
+
[2.2.0]: https://github.com/aoneahsan/capacitor-auth-manager/releases/tag/v2.2.0
|
|
@@ -14,23 +14,15 @@ Pod::Spec.new do |s|
|
|
|
14
14
|
s.ios.deployment_target = '14.0'
|
|
15
15
|
s.swift_version = '5.9'
|
|
16
16
|
s.dependency 'Capacitor'
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
|
|
20
|
-
s.dependency '
|
|
21
|
-
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# Firebase Auth (optional, can be added when needed)
|
|
28
|
-
# s.dependency 'Firebase/Auth'
|
|
29
|
-
|
|
17
|
+
|
|
18
|
+
# Google Sign-In — the only enabled provider as of 2.4.x (Firebase-agnostic). Pure-Swift SDK,
|
|
19
|
+
# no Objective-C bridging header required.
|
|
20
|
+
s.dependency 'GoogleSignIn', '~> 7.1'
|
|
21
|
+
|
|
22
|
+
# NOTE: Google-first build. The Facebook (FBSDKLoginKit) and Microsoft (MSAL) pod dependencies were
|
|
23
|
+
# removed so this plugin no longer pulls heavy auth SDKs into every consumer app. Those providers'
|
|
24
|
+
# Swift lives in ios/disabled-native-providers/ (not compiled, not shipped). Re-add a dependency here
|
|
25
|
+
# when its provider is re-enabled.
|
|
26
|
+
|
|
30
27
|
s.static_framework = true
|
|
31
|
-
|
|
32
|
-
# Required for Google Sign In
|
|
33
|
-
s.pod_target_xcconfig = {
|
|
34
|
-
'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/ios/Plugin/Plugin-Bridging-Header.h'
|
|
35
|
-
}
|
|
36
28
|
end
|
package/LICENSE
CHANGED