capacitor-auth-manager 1.1.0 → 2.1.0

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.
Files changed (89) hide show
  1. package/Readme.md +385 -640
  2. package/dist/core.cjs.js +4952 -0
  3. package/dist/core.cjs.js.map +1 -0
  4. package/dist/esm/capacitor-plugin.d.ts +3 -0
  5. package/dist/esm/capacitor-plugin.js +7 -0
  6. package/dist/esm/capacitor-plugin.js.map +1 -0
  7. package/dist/esm/core/auth-manager.d.ts +33 -0
  8. package/dist/esm/core/auth-manager.js +296 -0
  9. package/dist/esm/core/auth-manager.js.map +1 -0
  10. package/dist/esm/core/index.d.ts +4 -0
  11. package/dist/esm/core/index.js +5 -0
  12. package/dist/esm/core/index.js.map +1 -0
  13. package/dist/esm/core/platform.d.ts +17 -0
  14. package/dist/esm/core/platform.js +80 -0
  15. package/dist/esm/core/platform.js.map +1 -0
  16. package/dist/esm/core/provider-registry.d.ts +21 -0
  17. package/dist/esm/core/provider-registry.js +605 -0
  18. package/dist/esm/core/provider-registry.js.map +1 -0
  19. package/dist/esm/core/types.d.ts +35 -0
  20. package/dist/esm/core/types.js +2 -0
  21. package/dist/esm/core/types.js.map +1 -0
  22. package/dist/esm/definitions.d.ts +40 -5
  23. package/dist/esm/definitions.js +14 -4
  24. package/dist/esm/definitions.js.map +1 -1
  25. package/dist/esm/index.d.ts +7 -5
  26. package/dist/esm/index.js +8 -7
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/providers/base-provider.d.ts +3 -1
  29. package/dist/esm/providers/base-provider.js +8 -5
  30. package/dist/esm/providers/base-provider.js.map +1 -1
  31. package/dist/esm/providers/oauth-provider.js +18 -16
  32. package/dist/esm/providers/oauth-provider.js.map +1 -1
  33. package/dist/esm/providers/provider-factory.js +1 -1
  34. package/dist/esm/providers/provider-factory.js.map +1 -1
  35. package/dist/esm/providers/web/apple-provider.js +27 -19
  36. package/dist/esm/providers/web/apple-provider.js.map +1 -1
  37. package/dist/esm/providers/web/biometric-provider.d.ts +47 -0
  38. package/dist/esm/providers/web/biometric-provider.js +267 -0
  39. package/dist/esm/providers/web/biometric-provider.js.map +1 -0
  40. package/dist/esm/providers/web/email-password-provider.d.ts +55 -0
  41. package/dist/esm/providers/web/email-password-provider.js +429 -0
  42. package/dist/esm/providers/web/email-password-provider.js.map +1 -0
  43. package/dist/esm/providers/web/facebook-provider.d.ts +29 -0
  44. package/dist/esm/providers/web/facebook-provider.js +249 -0
  45. package/dist/esm/providers/web/facebook-provider.js.map +1 -0
  46. package/dist/esm/providers/web/firebase-provider.d.ts +20 -0
  47. package/dist/esm/providers/web/firebase-provider.js +306 -0
  48. package/dist/esm/providers/web/firebase-provider.js.map +1 -0
  49. package/dist/esm/providers/web/github-provider.d.ts +25 -0
  50. package/dist/esm/providers/web/github-provider.js +248 -0
  51. package/dist/esm/providers/web/github-provider.js.map +1 -0
  52. package/dist/esm/providers/web/google-provider.js +18 -14
  53. package/dist/esm/providers/web/google-provider.js.map +1 -1
  54. package/dist/esm/providers/web/index.d.ts +13 -0
  55. package/dist/esm/providers/web/index.js +15 -0
  56. package/dist/esm/providers/web/index.js.map +1 -0
  57. package/dist/esm/providers/web/linkedin-provider.d.ts +38 -0
  58. package/dist/esm/providers/web/linkedin-provider.js +152 -0
  59. package/dist/esm/providers/web/linkedin-provider.js.map +1 -0
  60. package/dist/esm/providers/web/magic-link-provider.d.ts +46 -0
  61. package/dist/esm/providers/web/magic-link-provider.js +298 -0
  62. package/dist/esm/providers/web/magic-link-provider.js.map +1 -0
  63. package/dist/esm/providers/web/microsoft-provider.d.ts +21 -0
  64. package/dist/esm/providers/web/microsoft-provider.js +211 -0
  65. package/dist/esm/providers/web/microsoft-provider.js.map +1 -0
  66. package/dist/esm/providers/web/slack-provider.d.ts +40 -0
  67. package/dist/esm/providers/web/slack-provider.js +151 -0
  68. package/dist/esm/providers/web/slack-provider.js.map +1 -0
  69. package/dist/esm/providers/web/sms-provider.d.ts +48 -0
  70. package/dist/esm/providers/web/sms-provider.js +301 -0
  71. package/dist/esm/providers/web/sms-provider.js.map +1 -0
  72. package/dist/esm/providers/web/username-password-provider.d.ts +62 -0
  73. package/dist/esm/providers/web/username-password-provider.js +432 -0
  74. package/dist/esm/providers/web/username-password-provider.js.map +1 -0
  75. package/dist/esm/utils/auth-error.js +7 -5
  76. package/dist/esm/utils/auth-error.js.map +1 -1
  77. package/dist/esm/utils/event-emitter.js +1 -1
  78. package/dist/esm/utils/event-emitter.js.map +1 -1
  79. package/dist/esm/utils/storage.d.ts +4 -4
  80. package/dist/esm/utils/storage.js +13 -3
  81. package/dist/esm/utils/storage.js.map +1 -1
  82. package/dist/esm/web.js +7 -3
  83. package/dist/esm/web.js.map +1 -1
  84. package/dist/plugin.cjs.js +4093 -354
  85. package/dist/plugin.cjs.js.map +1 -1
  86. package/dist/plugin.js +4093 -354
  87. package/dist/plugin.js.map +1 -1
  88. package/package.json +75 -14
  89. package/scripts/configure.js +105 -61
@@ -0,0 +1,605 @@
1
+ var _a;
2
+ import { PlatformDetector } from './platform';
3
+ export class ProviderRegistry {
4
+ static registerManifest(manifest) {
5
+ this.manifests.set(manifest.name, manifest);
6
+ }
7
+ static registerLoader(name, loader) {
8
+ this.loaders.set(name, loader);
9
+ }
10
+ static getManifest(name) {
11
+ return this.manifests.get(name);
12
+ }
13
+ static async getProvider(name, config) {
14
+ var _b, _c;
15
+ // Check if already loaded
16
+ const existing = this.providers.get(name);
17
+ if (existing) {
18
+ return existing;
19
+ }
20
+ // Check if loader exists
21
+ const loader = this.loaders.get(name);
22
+ if (!loader) {
23
+ const manifest = this.manifests.get(name);
24
+ if (manifest) {
25
+ throw new Error(`Provider '${name}' is not loaded.\n\n${manifest.setupInstructions || `Please configure the ${manifest.displayName} provider.`}`);
26
+ }
27
+ throw new Error(`Unknown provider: ${name}`);
28
+ }
29
+ // Check platform support
30
+ const manifest = this.manifests.get(name);
31
+ if (manifest === null || manifest === void 0 ? void 0 : manifest.platforms) {
32
+ const platform = PlatformDetector.getPlatform();
33
+ if (!manifest.platforms.includes(platform.platform)) {
34
+ throw new Error(`Provider '${name}' is not supported on ${platform.platform}`);
35
+ }
36
+ }
37
+ try {
38
+ // Load the provider
39
+ const module = await loader();
40
+ const ProviderClass = module.default;
41
+ // Create instance
42
+ const provider = new ProviderClass(config);
43
+ // Initialize if needed
44
+ if (provider.initialize) {
45
+ await provider.initialize(config);
46
+ }
47
+ // Cache the provider
48
+ this.providers.set(name, provider);
49
+ return provider;
50
+ }
51
+ catch (error) {
52
+ // Check if it's a missing dependency error
53
+ if (((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('Cannot find module')) ||
54
+ ((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('Failed to resolve module'))) {
55
+ const manifest = this.manifests.get(name);
56
+ if (manifest === null || manifest === void 0 ? void 0 : manifest.packageName) {
57
+ throw new Error(`Missing dependency for ${manifest.displayName} provider.\n\n` +
58
+ `Install the required package:\n` +
59
+ `npm install ${manifest.packageName}\n\n` +
60
+ `Then try again.`);
61
+ }
62
+ }
63
+ throw error;
64
+ }
65
+ }
66
+ static clearProvider(name) {
67
+ const provider = this.providers.get(name);
68
+ if (provider === null || provider === void 0 ? void 0 : provider.dispose) {
69
+ provider.dispose();
70
+ }
71
+ this.providers.delete(name);
72
+ }
73
+ static clearAll() {
74
+ for (const [, provider] of this.providers) {
75
+ if (provider.dispose) {
76
+ provider.dispose();
77
+ }
78
+ }
79
+ this.providers.clear();
80
+ }
81
+ static getAvailableProviders() {
82
+ return Array.from(this.manifests.keys());
83
+ }
84
+ static getSupportedProviders() {
85
+ const platform = PlatformDetector.getPlatform();
86
+ const supported = [];
87
+ for (const [name, manifest] of this.manifests) {
88
+ if (!manifest.platforms ||
89
+ manifest.platforms.includes(platform.platform)) {
90
+ supported.push(name);
91
+ }
92
+ }
93
+ return Promise.resolve(supported);
94
+ }
95
+ }
96
+ _a = ProviderRegistry;
97
+ ProviderRegistry.providers = new Map();
98
+ ProviderRegistry.loaders = new Map();
99
+ ProviderRegistry.manifests = new Map();
100
+ (() => {
101
+ // Register built-in provider manifests
102
+ _a.registerManifest({
103
+ name: 'google',
104
+ displayName: 'Google',
105
+ packageName: '@google/gsi',
106
+ setupInstructions: `
107
+ To use Google authentication, you need to:
108
+
109
+ 1. Install the Google Sign-In SDK:
110
+ npm install @google/gsi
111
+
112
+ 2. Configure your Google OAuth client:
113
+ - Go to https://console.cloud.google.com/
114
+ - Create or select a project
115
+ - Enable Google Sign-In API
116
+ - Create OAuth 2.0 credentials
117
+ - Add authorized JavaScript origins
118
+
119
+ 3. Configure the provider:
120
+ auth.configure({
121
+ providers: {
122
+ google: {
123
+ clientId: 'YOUR_CLIENT_ID'
124
+ }
125
+ }
126
+ })
127
+ `,
128
+ platforms: ['web', 'ios', 'android'],
129
+ configSchema: {
130
+ clientId: { type: 'string', required: true },
131
+ scopes: { type: 'array', items: 'string' },
132
+ hostedDomain: { type: 'string' },
133
+ },
134
+ });
135
+ _a.registerManifest({
136
+ name: 'apple',
137
+ displayName: 'Apple',
138
+ setupInstructions: `
139
+ To use Apple authentication:
140
+
141
+ 1. Configure Sign in with Apple:
142
+ - Go to https://developer.apple.com/
143
+ - Configure your app for Sign in with Apple
144
+ - Create a Services ID for web
145
+ - Configure return URLs
146
+
147
+ 2. Configure the provider:
148
+ auth.configure({
149
+ providers: {
150
+ apple: {
151
+ clientId: 'YOUR_SERVICE_ID',
152
+ redirectUri: 'YOUR_REDIRECT_URI'
153
+ }
154
+ }
155
+ })
156
+ `,
157
+ platforms: ['web', 'ios'],
158
+ configSchema: {
159
+ clientId: { type: 'string', required: true },
160
+ redirectUri: { type: 'string', required: true },
161
+ scopes: { type: 'array', items: 'string' },
162
+ },
163
+ });
164
+ _a.registerManifest({
165
+ name: 'firebase',
166
+ displayName: 'Firebase Auth',
167
+ packageName: 'firebase',
168
+ setupInstructions: `
169
+ To use Firebase authentication:
170
+
171
+ 1. Install Firebase SDK:
172
+ npm install firebase
173
+
174
+ 2. Configure Firebase:
175
+ - Go to https://console.firebase.google.com/
176
+ - Create or select a project
177
+ - Add your app (Web/iOS/Android)
178
+ - Copy the configuration
179
+
180
+ 3. Configure the provider:
181
+ auth.configure({
182
+ providers: {
183
+ firebase: {
184
+ apiKey: 'YOUR_API_KEY',
185
+ authDomain: 'YOUR_AUTH_DOMAIN',
186
+ projectId: 'YOUR_PROJECT_ID',
187
+ // ... other Firebase config
188
+ }
189
+ }
190
+ })
191
+ `,
192
+ platforms: ['web', 'ios', 'android'],
193
+ configSchema: {
194
+ apiKey: { type: 'string', required: true },
195
+ authDomain: { type: 'string', required: true },
196
+ projectId: { type: 'string', required: true },
197
+ },
198
+ });
199
+ _a.registerManifest({
200
+ name: 'microsoft',
201
+ displayName: 'Microsoft',
202
+ packageName: '@azure/msal-browser',
203
+ setupInstructions: `
204
+ To use Microsoft authentication:
205
+
206
+ 1. Install the Microsoft Authentication Library:
207
+ npm install @azure/msal-browser
208
+
209
+ 2. Configure your Azure AD app:
210
+ - Go to https://portal.azure.com/
211
+ - Create or select an app registration
212
+ - Add platform configuration for SPA
213
+ - Add redirect URIs
214
+
215
+ 3. Configure the provider:
216
+ auth.configure({
217
+ providers: {
218
+ microsoft: {
219
+ clientId: 'YOUR_CLIENT_ID',
220
+ authority: 'YOUR_AUTHORITY', // optional
221
+ redirectUri: 'YOUR_REDIRECT_URI' // optional
222
+ }
223
+ }
224
+ })
225
+ `,
226
+ platforms: ['web'],
227
+ configSchema: {
228
+ clientId: { type: 'string', required: true },
229
+ authority: { type: 'string' },
230
+ redirectUri: { type: 'string' },
231
+ scopes: { type: 'array', items: 'string' },
232
+ },
233
+ });
234
+ _a.registerManifest({
235
+ name: 'facebook',
236
+ displayName: 'Facebook',
237
+ setupInstructions: `
238
+ To use Facebook authentication:
239
+
240
+ 1. Configure your Facebook app:
241
+ - Go to https://developers.facebook.com/
242
+ - Create or select an app
243
+ - Add Facebook Login product
244
+ - Configure OAuth redirect URIs
245
+
246
+ 2. Add Facebook SDK to your HTML:
247
+ <script async defer crossorigin="anonymous"
248
+ src="https://connect.facebook.net/en_US/sdk.js"></script>
249
+
250
+ 3. Configure the provider:
251
+ auth.configure({
252
+ providers: {
253
+ facebook: {
254
+ appId: 'YOUR_APP_ID',
255
+ version: 'v18.0' // optional
256
+ }
257
+ }
258
+ })
259
+ `,
260
+ platforms: ['web'],
261
+ configSchema: {
262
+ appId: { type: 'string', required: true },
263
+ version: { type: 'string' },
264
+ scopes: { type: 'array', items: 'string' },
265
+ },
266
+ });
267
+ _a.registerManifest({
268
+ name: 'github',
269
+ displayName: 'GitHub',
270
+ setupInstructions: `
271
+ To use GitHub authentication:
272
+
273
+ 1. Configure your GitHub OAuth app:
274
+ - Go to https://github.com/settings/developers
275
+ - Create a new OAuth App
276
+ - Set authorization callback URL
277
+
278
+ 2. Configure the provider:
279
+ auth.configure({
280
+ providers: {
281
+ github: {
282
+ clientId: 'YOUR_CLIENT_ID',
283
+ redirectUri: 'YOUR_REDIRECT_URI'
284
+ }
285
+ }
286
+ })
287
+
288
+ Note: You'll need a backend service to exchange the authorization code for an access token.
289
+ `,
290
+ platforms: ['web'],
291
+ configSchema: {
292
+ clientId: { type: 'string', required: true },
293
+ redirectUri: { type: 'string' },
294
+ scopes: { type: 'array', items: 'string' },
295
+ },
296
+ });
297
+ // Register all new provider manifests
298
+ _a.registerManifest({
299
+ name: 'magic-link',
300
+ displayName: 'Email Magic Link',
301
+ setupInstructions: `
302
+ To use Email Magic Link authentication:
303
+
304
+ 1. Set up a backend endpoint to send emails:
305
+ - Endpoint should accept POST requests with email and magic link
306
+ - Send email with the magic link to the user
307
+
308
+ 2. Configure the provider:
309
+ auth.configure({
310
+ providers: {
311
+ 'magic-link': {
312
+ sendLinkUrl: 'https://your-api.com/send-magic-link',
313
+ verifyUrl: 'https://your-api.com/verify-magic-link', // Optional
314
+ redirectUrl: window.location.origin + '/auth-callback'
315
+ }
316
+ }
317
+ })
318
+ `,
319
+ platforms: ['web'],
320
+ configSchema: {
321
+ sendLinkUrl: { type: 'string', required: true },
322
+ verifyUrl: { type: 'string' },
323
+ redirectUrl: { type: 'string' },
324
+ },
325
+ });
326
+ _a.registerManifest({
327
+ name: 'sms',
328
+ displayName: 'SMS Authentication',
329
+ setupInstructions: `
330
+ To use SMS authentication:
331
+
332
+ 1. Set up backend endpoints:
333
+ - Send code endpoint: POST request to send SMS
334
+ - Verify code endpoint: POST request to verify SMS code
335
+
336
+ 2. Configure the provider:
337
+ auth.configure({
338
+ providers: {
339
+ sms: {
340
+ sendCodeUrl: 'https://your-api.com/sms/send',
341
+ verifyCodeUrl: 'https://your-api.com/sms/verify',
342
+ countryCode: '+1', // Default country code
343
+ codeLength: 6 // SMS code length
344
+ }
345
+ }
346
+ })
347
+ `,
348
+ platforms: ['web', 'ios', 'android'],
349
+ configSchema: {
350
+ sendCodeUrl: { type: 'string', required: true },
351
+ verifyCodeUrl: { type: 'string', required: true },
352
+ countryCode: { type: 'string' },
353
+ codeLength: { type: 'number' },
354
+ },
355
+ });
356
+ _a.registerManifest({
357
+ name: 'email-password',
358
+ displayName: 'Email & Password',
359
+ setupInstructions: `
360
+ To use Email/Password authentication:
361
+
362
+ 1. Set up backend API endpoints for authentication
363
+
364
+ 2. Configure the provider:
365
+ auth.configure({
366
+ providers: {
367
+ 'email-password': {
368
+ apiUrl: 'https://your-api.com',
369
+ passwordRequirements: {
370
+ minLength: 8,
371
+ requireUppercase: true,
372
+ requireNumbers: true
373
+ }
374
+ }
375
+ }
376
+ })
377
+ `,
378
+ platforms: ['web', 'ios', 'android'],
379
+ configSchema: {
380
+ apiUrl: { type: 'string', required: true },
381
+ passwordRequirements: { type: 'object' },
382
+ },
383
+ });
384
+ _a.registerManifest({
385
+ name: 'biometric',
386
+ displayName: 'Biometric Authentication',
387
+ packageName: 'capacitor-biometric-authentication',
388
+ setupInstructions: `
389
+ To use Biometric authentication:
390
+
391
+ 1. Install the capacitor-biometric-authentication plugin:
392
+ npm install capacitor-biometric-authentication
393
+ npx cap sync
394
+
395
+ 2. Configure the provider:
396
+ auth.configure({
397
+ providers: {
398
+ biometric: {
399
+ reason: 'Authenticate to access your account',
400
+ title: 'Authentication Required'
401
+ }
402
+ }
403
+ })
404
+
405
+ Note: Users must first authenticate with another method before enabling biometric authentication.
406
+ `,
407
+ platforms: ['ios', 'android'],
408
+ configSchema: {
409
+ reason: { type: 'string' },
410
+ title: { type: 'string' },
411
+ subtitle: { type: 'string' },
412
+ },
413
+ });
414
+ _a.registerManifest({
415
+ name: 'slack',
416
+ displayName: 'Slack',
417
+ setupInstructions: `
418
+ To use Slack authentication:
419
+
420
+ 1. Create a Slack App:
421
+ - Go to https://api.slack.com/apps
422
+ - Click "Create New App" > "From scratch"
423
+ - Name your app and select workspace
424
+
425
+ 2. Configure OAuth & Permissions:
426
+ - Add redirect URL: https://your-app.com/auth/slack/callback
427
+ - Add required scopes:
428
+ - openid
429
+ - profile
430
+ - email
431
+
432
+ 3. Get your credentials:
433
+ - Go to "Basic Information"
434
+ - Copy Client ID and Client Secret
435
+
436
+ 4. Configure the provider:
437
+ auth.configure({
438
+ providers: {
439
+ slack: {
440
+ clientId: 'YOUR_CLIENT_ID',
441
+ redirectUri: 'https://your-app.com/auth/slack/callback',
442
+ scopes: ['openid', 'profile', 'email'],
443
+ teamId: 'OPTIONAL_TEAM_ID' // Restrict to specific workspace
444
+ }
445
+ }
446
+ })
447
+
448
+ Note: Slack OAuth requires a backend service to exchange the authorization code for access tokens.
449
+ `,
450
+ platforms: ['web'],
451
+ configSchema: {
452
+ clientId: { type: 'string', required: true },
453
+ redirectUri: { type: 'string', required: true },
454
+ scopes: { type: 'array', items: 'string' },
455
+ teamId: { type: 'string' },
456
+ },
457
+ });
458
+ _a.registerManifest({
459
+ name: 'linkedin',
460
+ displayName: 'LinkedIn',
461
+ setupInstructions: `
462
+ To use LinkedIn authentication:
463
+
464
+ 1. Create a LinkedIn App:
465
+ - Go to https://www.linkedin.com/developers/apps
466
+ - Click "Create app"
467
+ - Fill in required information
468
+ - Verify your app
469
+
470
+ 2. Configure OAuth 2.0:
471
+ - Go to the "Auth" tab
472
+ - Add authorized redirect URLs:
473
+ - https://your-app.com/auth/linkedin/callback
474
+ - Note your Client ID and Client Secret
475
+
476
+ 3. Configure scopes:
477
+ - Under "OAuth 2.0 scopes", select:
478
+ - openid
479
+ - profile
480
+ - email
481
+
482
+ 4. Configure the provider:
483
+ auth.configure({
484
+ providers: {
485
+ linkedin: {
486
+ clientId: 'YOUR_CLIENT_ID',
487
+ redirectUri: 'https://your-app.com/auth/linkedin/callback',
488
+ scopes: ['openid', 'profile', 'email']
489
+ }
490
+ }
491
+ })
492
+
493
+ Note: LinkedIn OAuth requires a backend service to exchange the authorization code for access tokens.
494
+ The redirect URI must be HTTPS in production (LinkedIn requirement).
495
+ `,
496
+ platforms: ['web'],
497
+ configSchema: {
498
+ clientId: { type: 'string', required: true },
499
+ redirectUri: { type: 'string', required: true },
500
+ scopes: { type: 'array', items: 'string' },
501
+ },
502
+ });
503
+ _a.registerManifest({
504
+ name: 'username-password',
505
+ displayName: 'Username & Password',
506
+ setupInstructions: `
507
+ To use Username/Password authentication:
508
+
509
+ 1. Set up backend API endpoints:
510
+ - /auth/signin - Sign in with username/password
511
+ - /auth/signup - Create new account
512
+ - /auth/signout - Sign out user
513
+ - /auth/refresh - Refresh access token
514
+ - /auth/update-password - Update password
515
+ - /auth/check-username - Check username availability
516
+
517
+ 2. Configure the provider:
518
+ auth.configure({
519
+ providers: {
520
+ 'username-password': {
521
+ apiUrl: 'https://your-api.com',
522
+ usernameRequirements: {
523
+ minLength: 3,
524
+ maxLength: 20,
525
+ allowedCharacters: /^[a-zA-Z0-9_-]+$/,
526
+ reservedUsernames: ['admin', 'root', 'system']
527
+ },
528
+ passwordRequirements: {
529
+ minLength: 8,
530
+ requireUppercase: true,
531
+ requireLowercase: true,
532
+ requireNumbers: true,
533
+ requireSpecialChars: false
534
+ },
535
+ allowSignUp: true
536
+ }
537
+ }
538
+ })
539
+
540
+ 3. Sign in:
541
+ await auth.signIn('username-password', {
542
+ username: 'johndoe',
543
+ password: 'password123'
544
+ });
545
+
546
+ 4. Sign up:
547
+ await auth.signUp({
548
+ username: 'johndoe',
549
+ password: 'password123',
550
+ email: 'john@example.com', // optional
551
+ displayName: 'John Doe' // optional
552
+ });
553
+
554
+ Note: This provider requires a backend service to handle authentication.
555
+ `,
556
+ platforms: ['web', 'ios', 'android'],
557
+ configSchema: {
558
+ apiUrl: { type: 'string', required: true },
559
+ usernameRequirements: { type: 'object' },
560
+ passwordRequirements: { type: 'object' },
561
+ allowSignUp: { type: 'boolean' },
562
+ },
563
+ });
564
+ // Register provider loaders
565
+ _a.registerLoader('google', () => import('../providers/web/google-provider').then((m) => ({
566
+ default: m.GoogleAuthProviderWeb,
567
+ })));
568
+ _a.registerLoader('apple', () => import('../providers/web/apple-provider').then((m) => ({
569
+ default: m.AppleAuthProviderWeb,
570
+ })));
571
+ _a.registerLoader('microsoft', () => import('../providers/web/microsoft-provider').then((m) => ({
572
+ default: m.MicrosoftAuthProviderWeb,
573
+ })));
574
+ _a.registerLoader('facebook', () => import('../providers/web/facebook-provider').then((m) => ({
575
+ default: m.FacebookAuthProviderWeb,
576
+ })));
577
+ _a.registerLoader('github', () => import('../providers/web/github-provider').then((m) => ({
578
+ default: m.GitHubAuthProviderWeb,
579
+ })));
580
+ _a.registerLoader('firebase', () => import('../providers/web/firebase-provider').then((m) => ({
581
+ default: m.FirebaseAuthProviderWeb,
582
+ })));
583
+ _a.registerLoader('magic-link', () => import('../providers/web/magic-link-provider').then((m) => ({
584
+ default: m.MagicLinkProvider,
585
+ })));
586
+ _a.registerLoader('sms', () => import('../providers/web/sms-provider').then((m) => ({
587
+ default: m.SMSProvider,
588
+ })));
589
+ _a.registerLoader('email-password', () => import('../providers/web/email-password-provider').then((m) => ({
590
+ default: m.EmailPasswordProvider,
591
+ })));
592
+ _a.registerLoader('biometric', () => import('../providers/web/biometric-provider').then((m) => ({
593
+ default: m.BiometricProvider,
594
+ })));
595
+ _a.registerLoader('slack', () => import('../providers/web/slack-provider').then((m) => ({
596
+ default: m.SlackProvider,
597
+ })));
598
+ _a.registerLoader('linkedin', () => import('../providers/web/linkedin-provider').then((m) => ({
599
+ default: m.LinkedInProvider,
600
+ })));
601
+ _a.registerLoader('username-password', () => import('../providers/web/username-password-provider').then((m) => ({
602
+ default: m.UsernamePasswordProvider,
603
+ })));
604
+ })();
605
+ //# sourceMappingURL=provider-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-registry.js","sourceRoot":"","sources":["../../../src/core/provider-registry.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQ9C,MAAM,OAAO,gBAAgB;IAsiB3B,MAAM,CAAC,gBAAgB,CAAC,QAA0B;QAChD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,IAAY,EAAE,MAAsB;QACxD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CACtB,IAAY,EACZ,MAAY;;QAEZ,0BAA0B;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,yBAAyB;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,QAA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C;IACF,GAAK,cAAc,CAAC,UAAU,EAAE,GAAG,EAAE,CACnC,MAAM,CAAC,oCAAoC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxD,OAAO,EAAE,CAAC,CAAC,gBAAgB;KAC5B,CAAC,CAAC,CACJ,CAAC;IACF,GAAK,cAAc,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAC5C,MAAM,CAAC,6CAA6C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjE,OAAO,EAAE,CAAC,CAAC,wBAAwB;KACpC,CAAC,CAAC,CACJ,CAAC;AACJ,CAAC,GAAA,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type { AuthUser, AuthResult } from '../definitions';
2
+ export interface AuthManagerConfig {
3
+ providers?: Record<string, any>;
4
+ persistence?: 'local' | 'session' | 'memory';
5
+ autoRefreshToken?: boolean;
6
+ tokenRefreshBuffer?: number;
7
+ enableLogging?: boolean;
8
+ logLevel?: 'debug' | 'info' | 'warn' | 'error';
9
+ }
10
+ export interface AuthState {
11
+ user: AuthUser | null;
12
+ isLoading: boolean;
13
+ isAuthenticated: boolean;
14
+ provider: string | null;
15
+ }
16
+ export type AuthStateListener = (state: AuthState) => void;
17
+ export interface AuthProviderInterface {
18
+ name: string;
19
+ signIn(options?: any): Promise<AuthResult>;
20
+ signOut(options?: any): Promise<void>;
21
+ getCurrentUser(): Promise<AuthUser | null>;
22
+ refreshToken?(options?: any): Promise<AuthResult>;
23
+ isSupported(): Promise<boolean>;
24
+ initialize?(config: any): Promise<void>;
25
+ dispose?(): void;
26
+ }
27
+ export interface ProviderManifest {
28
+ name: string;
29
+ displayName: string;
30
+ packageName?: string;
31
+ importPath?: string;
32
+ setupInstructions?: string;
33
+ configSchema?: Record<string, any>;
34
+ platforms?: ('web' | 'ios' | 'android' | 'electron')[];
35
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":""}