@nauth-toolkit/social-google 0.1.3

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 (36) hide show
  1. package/LICENSE +90 -0
  2. package/README.md +30 -0
  3. package/dist/nestjs/google-social-auth.module.d.ts +10 -0
  4. package/dist/nestjs/google-social-auth.module.d.ts.map +1 -0
  5. package/dist/nestjs/google-social-auth.module.js +72 -0
  6. package/dist/nestjs/google-social-auth.module.js.map +1 -0
  7. package/dist/nestjs/index.d.ts +7 -0
  8. package/dist/nestjs/index.d.ts.map +1 -0
  9. package/dist/nestjs/index.js +25 -0
  10. package/dist/nestjs/index.js.map +1 -0
  11. package/dist/src/dto/social-login.dto.d.ts +47 -0
  12. package/dist/src/dto/social-login.dto.d.ts.map +1 -0
  13. package/dist/src/dto/social-login.dto.js +131 -0
  14. package/dist/src/dto/social-login.dto.js.map +1 -0
  15. package/dist/src/google-oauth.client.d.ts +15 -0
  16. package/dist/src/google-oauth.client.d.ts.map +1 -0
  17. package/dist/src/google-oauth.client.js +95 -0
  18. package/dist/src/google-oauth.client.js.map +1 -0
  19. package/dist/src/google-social-auth.service.d.ts +16 -0
  20. package/dist/src/google-social-auth.service.d.ts.map +1 -0
  21. package/dist/src/google-social-auth.service.js +78 -0
  22. package/dist/src/google-social-auth.service.js.map +1 -0
  23. package/dist/src/index.d.ts +6 -0
  24. package/dist/src/index.d.ts.map +1 -0
  25. package/dist/src/index.js +25 -0
  26. package/dist/src/index.js.map +1 -0
  27. package/dist/src/token-verifier.service.d.ts +9 -0
  28. package/dist/src/token-verifier.service.d.ts.map +1 -0
  29. package/dist/src/token-verifier.service.js +61 -0
  30. package/dist/src/token-verifier.service.js.map +1 -0
  31. package/dist/src/verified-token-profile.interface.d.ts +9 -0
  32. package/dist/src/verified-token-profile.interface.d.ts.map +1 -0
  33. package/dist/src/verified-token-profile.interface.js +3 -0
  34. package/dist/src/verified-token-profile.interface.js.map +1 -0
  35. package/dist/tsconfig.tsbuildinfo +1 -0
  36. package/package.json +68 -0
package/LICENSE ADDED
@@ -0,0 +1,90 @@
1
+ NAUTH TOOLKIT EARLY ACCESS LICENSE
2
+ Version 1.0 (December 2025)
3
+
4
+ ================================================================================
5
+ FUTURE OPEN SOURCE NOTICE
6
+ ================================================================================
7
+ NAuth Toolkit will transition to an open-source license (MIT or Apache 2.0) for
8
+ core authentication features once the project reaches production readiness.
9
+
10
+ This Early Access License is temporary and designed to:
11
+ • Allow developers to build with nauth-toolkit during preview/beta
12
+ • Provide clear expectations during the pre-release phase
13
+ • Enable feedback and real-world testing before GA
14
+
15
+ We're committed to keeping core auth free and open source. Premium features
16
+ (enterprise SSO, advanced compliance, hosted options) will be offered separately
17
+ under fair commercial terms.
18
+
19
+ ================================================================================
20
+ EARLY ACCESS LICENSE TERMS
21
+ ================================================================================
22
+
23
+ 1. Grant of Use
24
+ You are granted a free, non-exclusive, non-transferable license to:
25
+ - Install and use nauth-toolkit packages in development, testing, staging,
26
+ and production environments
27
+ - Modify the code for your own internal use
28
+ - Deploy applications using nauth-toolkit to serve your users
29
+
30
+ You may NOT:
31
+ - Redistribute NAuth Toolkit as a standalone product or service
32
+ - Sell, sublicense, or offer NAuth Toolkit as part of a competing auth
33
+ platform or toolkit
34
+ - Remove or alter copyright notices
35
+
36
+ 2. No Fees During Early Access
37
+ There are no license fees, subscription costs, or usage charges during the
38
+ Early Access period. You may use nauth-toolkit freely for commercial and
39
+ non-commercial purposes within the terms of this license.
40
+
41
+ 3. Production Use
42
+ Production use is permitted but comes with standard early-access caveats:
43
+ - Features and APIs may change between preview releases
44
+ - Support is community-based (GitHub issues/discussions)
45
+ - No SLA or guaranteed uptime (you run it on your infrastructure)
46
+
47
+ We recommend thorough testing and having rollback plans for critical systems.
48
+
49
+ 4. Future Transition
50
+ When nauth-toolkit releases v1.0 GA:
51
+ - Core packages will adopt an open-source license (MIT or Apache 2.0)
52
+ - Your existing deployments will continue to work
53
+ - Premium features (if any) will be clearly documented with separate licensing
54
+ - No forced upgrades or surprise fees
55
+
56
+ 5. Ownership
57
+ NAuth Toolkit is developed and maintained by Noorix Digital Solutions.
58
+ You retain full ownership of your applications and data.
59
+
60
+ 6. Data and Privacy
61
+ NAuth Toolkit runs in YOUR infrastructure and database. You control all data.
62
+ You are responsible for compliance with applicable data protection laws.
63
+
64
+ 7. Disclaimer of Warranty
65
+ THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
66
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
67
+ FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
68
+
69
+ 8. Limitation of Liability
70
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
71
+ SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS
72
+ OF PROFITS, REVENUE, DATA, OR USE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
73
+ DAMAGES.
74
+
75
+ 9. Termination
76
+ This license remains in effect until:
77
+ - You stop using nauth-toolkit, or
78
+ - The project transitions to open source (at which point the new license applies)
79
+
80
+ If you breach these terms, your license terminates and you must stop using the
81
+ software.
82
+
83
+ 10. Contact and Support
84
+ - Documentation: https://nauth.dev
85
+ - Issues/Discussions: GitHub (when public repository launches)
86
+ - Commercial inquiries: Contact admin@noorix.com
87
+
88
+ ================================================================================
89
+ Thank you for being an early adopter. Your feedback shapes the future of NAuth.
90
+ ================================================================================
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # @nauth-toolkit/social-google
2
+
3
+ Google OAuth provider for nauth-toolkit
4
+
5
+ ## ⚠️ Preview Release Notice
6
+
7
+ **This is a preview release for internal testing. Do not use in production yet.**
8
+
9
+ This package is part of nauth-toolkit and is currently in early access/preview. Features and APIs may change between releases. For production use, please wait for the stable v1.0 release.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install @nauth-toolkit/social-google@preview
15
+ # or
16
+ yarn add @nauth-toolkit/social-google@preview
17
+ ```
18
+
19
+ ## License
20
+
21
+ See LICENSE file in the package root for full license terms.
22
+
23
+ ## Documentation
24
+
25
+ Full documentation: https://nauth.dev
26
+
27
+ ## Support
28
+
29
+ - Issues/Discussions: GitHub (when repository is public)
30
+ - Documentation: https://nauth.dev
@@ -0,0 +1,10 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { GoogleSocialAuthService } from '../src/google-social-auth.service';
3
+ import { SocialProviderRegistry } from '@nauth-toolkit/core/internal';
4
+ export declare class GoogleSocialAuthModule implements OnModuleInit {
5
+ private readonly googleSocialAuthService;
6
+ private readonly providerRegistry;
7
+ constructor(googleSocialAuthService: GoogleSocialAuthService, providerRegistry: SocialProviderRegistry);
8
+ onModuleInit(): void;
9
+ }
10
+ //# sourceMappingURL=google-social-auth.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-social-auth.module.d.ts","sourceRoot":"","sources":["../../nestjs/google-social-auth.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAY5E,OAAO,EAIL,sBAAsB,EAGvB,MAAM,8BAA8B,CAAC;AAoCtC,qBAsEa,sBAAuB,YAAW,YAAY;IAEvD,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBADhB,uBAAuB,EAAE,uBAAuB,EAChD,gBAAgB,EAAE,sBAAsB;IAQ3D,YAAY,IAAI,IAAI;CAUrB"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GoogleSocialAuthModule = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const google_social_auth_service_1 = require("../src/google-social-auth.service");
15
+ const core_1 = require("@nauth-toolkit/core");
16
+ const internal_1 = require("@nauth-toolkit/core/internal");
17
+ const token_verifier_service_1 = require("../src/token-verifier.service");
18
+ let GoogleSocialAuthModule = class GoogleSocialAuthModule {
19
+ googleSocialAuthService;
20
+ providerRegistry;
21
+ constructor(googleSocialAuthService, providerRegistry) {
22
+ this.googleSocialAuthService = googleSocialAuthService;
23
+ this.providerRegistry = providerRegistry;
24
+ }
25
+ onModuleInit() {
26
+ const config = this.googleSocialAuthService['config'];
27
+ const providerConfig = config.social?.google;
28
+ if (providerConfig?.enabled) {
29
+ this.providerRegistry.registerProvider(this.googleSocialAuthService);
30
+ }
31
+ }
32
+ };
33
+ exports.GoogleSocialAuthModule = GoogleSocialAuthModule;
34
+ exports.GoogleSocialAuthModule = GoogleSocialAuthModule = __decorate([
35
+ (0, common_1.Module)({
36
+ providers: [
37
+ {
38
+ provide: 'GOOGLE_TOKEN_VERIFIER',
39
+ useFactory: (config) => {
40
+ return new token_verifier_service_1.TokenVerifierService(config);
41
+ },
42
+ inject: ['NAUTH_CONFIG'],
43
+ },
44
+ {
45
+ provide: google_social_auth_service_1.GoogleSocialAuthService,
46
+ useFactory: (config, logger, authService, socialAuthService, jwtService, sessionService, challengeHelper, clientInfoService, stateStore, userRepository, phoneVerificationService, auditService, trustedDeviceService, tokenVerifier) => {
47
+ return new google_social_auth_service_1.GoogleSocialAuthService(config, logger, authService, socialAuthService, jwtService, sessionService, challengeHelper, clientInfoService, stateStore, userRepository, phoneVerificationService, auditService, trustedDeviceService, tokenVerifier);
48
+ },
49
+ inject: [
50
+ 'NAUTH_CONFIG',
51
+ 'NAUTH_LOGGER',
52
+ core_1.AuthService,
53
+ core_1.SocialAuthService,
54
+ internal_1.JwtService,
55
+ internal_1.SessionService,
56
+ internal_1.AuthChallengeHelperService,
57
+ core_1.ClientInfoService,
58
+ 'SOCIAL_AUTH_STATE_STORE',
59
+ 'UserRepository',
60
+ { token: core_1.PhoneVerificationService, optional: true },
61
+ { token: internal_1.AuthAuditService, optional: true },
62
+ { token: internal_1.TrustedDeviceService, optional: true },
63
+ { token: 'GOOGLE_TOKEN_VERIFIER', optional: true },
64
+ ],
65
+ },
66
+ ],
67
+ exports: [google_social_auth_service_1.GoogleSocialAuthService],
68
+ }),
69
+ __metadata("design:paramtypes", [google_social_auth_service_1.GoogleSocialAuthService,
70
+ internal_1.SocialProviderRegistry])
71
+ ], GoogleSocialAuthModule);
72
+ //# sourceMappingURL=google-social-auth.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-social-auth.module.js","sourceRoot":"","sources":["../../nestjs/google-social-auth.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAsD;AACtD,kFAA4E;AAE5E,8CAQ6B;AAE7B,2DAOsC;AACtC,0EAAmG;AAyG5F,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAEd;IACA;IAFnB,YACmB,uBAAgD,EAChD,gBAAwC;QADxC,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,qBAAgB,GAAhB,gBAAgB,CAAwB;IACxD,CAAC;IAOJ,YAAY;QAGV,MAAM,MAAM,GAAG,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAgB,CAAC;QACrE,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC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EAAE,IAAI,EAAE;oBAC/C,EAAE,KAAK,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE;iBACnD;aACF;SACF;QACD,OAAO,EAAE,CAAC,oDAAuB,CAAC;KACnC,CAAC;qCAG4C,oDAAuB;QAC9B,iCAAsB;GAHhD,sBAAsB,CAqBlC"}
@@ -0,0 +1,7 @@
1
+ export { GoogleSocialAuthModule } from './google-social-auth.module';
2
+ export * from '../src/google-social-auth.service';
3
+ export * from '../src/google-oauth.client';
4
+ export * from '../src/token-verifier.service';
5
+ export * from '../src/verified-token-profile.interface';
6
+ export * from '../src/dto/social-login.dto';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../nestjs/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.GoogleSocialAuthModule = void 0;
18
+ var google_social_auth_module_1 = require("./google-social-auth.module");
19
+ Object.defineProperty(exports, "GoogleSocialAuthModule", { enumerable: true, get: function () { return google_social_auth_module_1.GoogleSocialAuthModule; } });
20
+ __exportStar(require("../src/google-social-auth.service"), exports);
21
+ __exportStar(require("../src/google-oauth.client"), exports);
22
+ __exportStar(require("../src/token-verifier.service"), exports);
23
+ __exportStar(require("../src/verified-token-profile.interface"), exports);
24
+ __exportStar(require("../src/dto/social-login.dto"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../nestjs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMA,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAG/B,oEAAkD;AAClD,6DAA2C;AAC3C,gEAA8C;AAC9C,0EAAwD;AACxD,8DAA4C"}
@@ -0,0 +1,47 @@
1
+ export declare enum SocialProvider {
2
+ GOOGLE = "google",
3
+ APPLE = "apple",
4
+ FACEBOOK = "facebook"
5
+ }
6
+ export declare class SocialLoginDTO {
7
+ provider: SocialProvider;
8
+ state?: string;
9
+ }
10
+ export declare class SocialCallbackDTO {
11
+ provider: SocialProvider;
12
+ code: string;
13
+ state: string;
14
+ error?: string;
15
+ error_description?: string;
16
+ }
17
+ export declare class LinkSocialAccountDTO {
18
+ provider: SocialProvider;
19
+ code: string;
20
+ state: string;
21
+ }
22
+ export declare class UnlinkSocialAccountDTO {
23
+ provider: SocialProvider;
24
+ }
25
+ export declare class SocialLoginResponseDTO {
26
+ accessToken: string;
27
+ refreshToken: string;
28
+ accessTokenExpiresAt: number;
29
+ refreshTokenExpiresAt: number;
30
+ user: {
31
+ sub: string;
32
+ email: string;
33
+ firstName?: string;
34
+ lastName?: string;
35
+ isEmailVerified: boolean;
36
+ socialProviders?: string[];
37
+ };
38
+ }
39
+ export declare class SocialAccountsResponseDTO {
40
+ accounts: Array<{
41
+ provider: string;
42
+ providerEmail?: string;
43
+ linkedAt: Date;
44
+ lastUsedAt?: Date;
45
+ }>;
46
+ }
47
+ //# sourceMappingURL=social-login.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-login.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/social-login.dto.ts"],"names":[],"mappings":"AAKA,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,QAAQ,aAAa;CACtB;AAcD,qBAAa,cAAc;IASzB,QAAQ,EAAG,cAAc,CAAC;IAc1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAeD,qBAAa,iBAAiB;IAS5B,QAAQ,EAAG,cAAc,CAAC;IAa1B,IAAI,EAAG,MAAM,CAAC;IAad,KAAK,EAAG,MAAM,CAAC;IAaf,KAAK,CAAC,EAAE,MAAM,CAAC;IAaf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAeD,qBAAa,oBAAoB;IAS/B,QAAQ,EAAG,cAAc,CAAC;IAa1B,IAAI,EAAG,MAAM,CAAC;IAad,KAAK,EAAG,MAAM,CAAC;CAChB;AAaD,qBAAa,sBAAsB;IASjC,QAAQ,EAAG,cAAc,CAAC;CAC3B;AAwBD,qBAAa,sBAAsB;IAUjC,WAAW,EAAG,MAAM,CAAC;IAWrB,YAAY,EAAG,MAAM,CAAC;IAStB,oBAAoB,EAAG,MAAM,CAAC;IAS9B,qBAAqB,EAAG,MAAM,CAAC;IAc/B,IAAI,EAAG;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,OAAO,CAAC;QACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5B,CAAC;CACH;AAqBD,qBAAa,yBAAyB;IAIpC,QAAQ,EAAG,KAAK,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,IAAI,CAAC;QACf,UAAU,CAAC,EAAE,IAAI,CAAC;KACnB,CAAC,CAAC;CACJ"}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SocialAccountsResponseDTO = exports.SocialLoginResponseDTO = exports.UnlinkSocialAccountDTO = exports.LinkSocialAccountDTO = exports.SocialCallbackDTO = exports.SocialLoginDTO = exports.SocialProvider = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ var SocialProvider;
15
+ (function (SocialProvider) {
16
+ SocialProvider["GOOGLE"] = "google";
17
+ SocialProvider["APPLE"] = "apple";
18
+ SocialProvider["FACEBOOK"] = "facebook";
19
+ })(SocialProvider || (exports.SocialProvider = SocialProvider = {}));
20
+ class SocialLoginDTO {
21
+ provider;
22
+ state;
23
+ }
24
+ exports.SocialLoginDTO = SocialLoginDTO;
25
+ __decorate([
26
+ (0, class_validator_1.IsEnum)(SocialProvider, { message: 'Provider must be one of: google, apple, facebook' }),
27
+ __metadata("design:type", String)
28
+ ], SocialLoginDTO.prototype, "provider", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsOptional)(),
31
+ (0, class_validator_1.IsString)({ message: 'State must be a string' }),
32
+ (0, class_validator_1.MaxLength)(500, { message: 'State must not exceed 500 characters' }),
33
+ __metadata("design:type", String)
34
+ ], SocialLoginDTO.prototype, "state", void 0);
35
+ class SocialCallbackDTO {
36
+ provider;
37
+ code;
38
+ state;
39
+ error;
40
+ error_description;
41
+ }
42
+ exports.SocialCallbackDTO = SocialCallbackDTO;
43
+ __decorate([
44
+ (0, class_validator_1.IsEnum)(SocialProvider, { message: 'Provider must be one of: google, apple, facebook' }),
45
+ __metadata("design:type", String)
46
+ ], SocialCallbackDTO.prototype, "provider", void 0);
47
+ __decorate([
48
+ (0, class_validator_1.IsString)({ message: 'Authorization code must be a string' }),
49
+ (0, class_validator_1.IsNotEmpty)({ message: 'Authorization code is required' }),
50
+ (0, class_validator_1.MaxLength)(1000, { message: 'Authorization code must not exceed 1000 characters' }),
51
+ __metadata("design:type", String)
52
+ ], SocialCallbackDTO.prototype, "code", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.IsString)({ message: 'State must be a string' }),
55
+ (0, class_validator_1.IsNotEmpty)({ message: 'State is required' }),
56
+ (0, class_validator_1.MaxLength)(500, { message: 'State must not exceed 500 characters' }),
57
+ __metadata("design:type", String)
58
+ ], SocialCallbackDTO.prototype, "state", void 0);
59
+ __decorate([
60
+ (0, class_validator_1.IsOptional)(),
61
+ (0, class_validator_1.IsString)({ message: 'Error must be a string' }),
62
+ (0, class_validator_1.MaxLength)(100, { message: 'Error must not exceed 100 characters' }),
63
+ __metadata("design:type", String)
64
+ ], SocialCallbackDTO.prototype, "error", void 0);
65
+ __decorate([
66
+ (0, class_validator_1.IsOptional)(),
67
+ (0, class_validator_1.IsString)({ message: 'Error description must be a string' }),
68
+ (0, class_validator_1.MaxLength)(500, { message: 'Error description must not exceed 500 characters' }),
69
+ __metadata("design:type", String)
70
+ ], SocialCallbackDTO.prototype, "error_description", void 0);
71
+ class LinkSocialAccountDTO {
72
+ provider;
73
+ code;
74
+ state;
75
+ }
76
+ exports.LinkSocialAccountDTO = LinkSocialAccountDTO;
77
+ __decorate([
78
+ (0, class_validator_1.IsEnum)(SocialProvider, { message: 'Provider must be one of: google, apple, facebook' }),
79
+ __metadata("design:type", String)
80
+ ], LinkSocialAccountDTO.prototype, "provider", void 0);
81
+ __decorate([
82
+ (0, class_validator_1.IsString)({ message: 'Authorization code must be a string' }),
83
+ (0, class_validator_1.IsNotEmpty)({ message: 'Authorization code is required' }),
84
+ (0, class_validator_1.MaxLength)(1000, { message: 'Authorization code must not exceed 1000 characters' }),
85
+ __metadata("design:type", String)
86
+ ], LinkSocialAccountDTO.prototype, "code", void 0);
87
+ __decorate([
88
+ (0, class_validator_1.IsString)({ message: 'State must be a string' }),
89
+ (0, class_validator_1.IsNotEmpty)({ message: 'State is required' }),
90
+ (0, class_validator_1.MaxLength)(500, { message: 'State must not exceed 500 characters' }),
91
+ __metadata("design:type", String)
92
+ ], LinkSocialAccountDTO.prototype, "state", void 0);
93
+ class UnlinkSocialAccountDTO {
94
+ provider;
95
+ }
96
+ exports.UnlinkSocialAccountDTO = UnlinkSocialAccountDTO;
97
+ __decorate([
98
+ (0, class_validator_1.IsEnum)(SocialProvider, { message: 'Provider must be one of: google, apple, facebook' }),
99
+ __metadata("design:type", String)
100
+ ], UnlinkSocialAccountDTO.prototype, "provider", void 0);
101
+ class SocialLoginResponseDTO {
102
+ accessToken;
103
+ refreshToken;
104
+ accessTokenExpiresAt;
105
+ refreshTokenExpiresAt;
106
+ user;
107
+ }
108
+ exports.SocialLoginResponseDTO = SocialLoginResponseDTO;
109
+ __decorate([
110
+ (0, class_validator_1.IsString)({ message: 'Access token must be a string' }),
111
+ (0, class_validator_1.MaxLength)(2048, { message: 'Access token must not exceed 2048 characters' }),
112
+ __metadata("design:type", String)
113
+ ], SocialLoginResponseDTO.prototype, "accessToken", void 0);
114
+ __decorate([
115
+ (0, class_validator_1.IsString)({ message: 'Refresh token must be a string' }),
116
+ (0, class_validator_1.MaxLength)(2048, { message: 'Refresh token must not exceed 2048 characters' }),
117
+ __metadata("design:type", String)
118
+ ], SocialLoginResponseDTO.prototype, "refreshToken", void 0);
119
+ __decorate([
120
+ (0, class_validator_1.IsNumber)({}, { message: 'Access token expiration must be a number' }),
121
+ __metadata("design:type", Number)
122
+ ], SocialLoginResponseDTO.prototype, "accessTokenExpiresAt", void 0);
123
+ __decorate([
124
+ (0, class_validator_1.IsNumber)({}, { message: 'Refresh token expiration must be a number' }),
125
+ __metadata("design:type", Number)
126
+ ], SocialLoginResponseDTO.prototype, "refreshTokenExpiresAt", void 0);
127
+ class SocialAccountsResponseDTO {
128
+ accounts;
129
+ }
130
+ exports.SocialAccountsResponseDTO = SocialAccountsResponseDTO;
131
+ //# sourceMappingURL=social-login.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-login.dto.js","sourceRoot":"","sources":["../../../src/dto/social-login.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAgG;AAKhG,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,iCAAe,CAAA;IACf,uCAAqB,CAAA;AACvB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAcD,MAAa,cAAc;IASzB,QAAQ,CAAkB;IAc1B,KAAK,CAAU;CAChB;AAxBD,wCAwBC;AAfC;IADC,IAAA,wBAAM,EAAC,cAAc,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE,CAAC;;gDAC9D;AAc1B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;IAC/C,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;;6CACrD;AAgBjB,MAAa,iBAAiB;IAS5B,QAAQ,CAAkB;IAa1B,IAAI,CAAU;IAad,KAAK,CAAU;IAaf,KAAK,CAAU;IAaf,iBAAiB,CAAU;CAC5B;AA9DD,8CA8DC;AArDC;IADC,IAAA,wBAAM,EAAC,cAAc,EAAE,EAAE,OAAO,EAAE,kDA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AAC;;kDACrE;AAad;IAHC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;IAC/C,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC5C,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;;mDACrD;AAcjB,MAAa,sBAAsB;IASjC,QAAQ,CAAkB;CAC3B;AAVD,wDAUC;AADC;IADC,IAAA,wBAAM,EAAC,cAAc,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE,CAAC;;wDAC9D;AAyB5B,MAAa,sBAAsB;IAUjC,WAAW,CAAU;IAWrB,YAAY,CAAU;IAStB,oBAAoB,CAAU;IAS9B,qBAAqB,CAAU;IAc/B,IAAI,CAOF;CACH;AA7DD,wDA6DC;AAnDC;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC;IACtD,IAAA,2BAAS,EAAC,IAAI,EAAE,EAAE,OAAO,EAAE,8CAA8C,EAAE,CAAC;;2DACxD;AAWrB;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC;IACvD,IAAA,2BAAS,EAAC,IAAI,EAAE,EAAE,OAAO,EAAE,+CAA+C,EAAE,CAAC;;4DACxD;AAStB;IADC,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;;oEACxC;AAS9B;IADC,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC;;qEACxC;AA2CjC,MAAa,yBAAyB;IAIpC,QAAQ,CAKL;CACJ;AAVD,8DAUC"}
@@ -0,0 +1,15 @@
1
+ import { OAuthClient, OAuthConfig, OAuthUserProfile } from '@nauth-toolkit/core';
2
+ export declare class GoogleOAuthClient implements OAuthClient {
3
+ private readonly config;
4
+ private readonly tokenEndpoint;
5
+ private readonly userInfoEndpoint;
6
+ constructor(config: OAuthConfig);
7
+ exchangeCodeForToken(code: string, redirectUri: string): Promise<{
8
+ accessToken: string;
9
+ refreshToken?: string;
10
+ expiresIn?: number;
11
+ }>;
12
+ getUserProfile(accessToken: string): Promise<OAuthUserProfile>;
13
+ getAuthorizationUrl(state?: string): string;
14
+ }
15
+ //# sourceMappingURL=google-oauth.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-oauth.client.d.ts","sourceRoot":"","sources":["../../src/google-oauth.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAiC,MAAM,qBAAqB,CAAC;AAqBhH,qBAAa,iBAAkB,YAAW,WAAW;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAyC;IACvE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmD;gBAExE,MAAM,EAAE,WAAW;IAqBzB,oBAAoB,CACxB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QACT,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAuDI,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkDpE,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;CAiB5C"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GoogleOAuthClient = void 0;
4
+ const core_1 = require("@nauth-toolkit/core");
5
+ class GoogleOAuthClient {
6
+ config;
7
+ tokenEndpoint = 'https://oauth2.googleapis.com/token';
8
+ userInfoEndpoint = 'https://www.googleapis.com/oauth2/v2/userinfo';
9
+ constructor(config) {
10
+ this.config = {
11
+ scopes: ['openid', 'email', 'profile'],
12
+ ...config,
13
+ };
14
+ }
15
+ async exchangeCodeForToken(code, redirectUri) {
16
+ const params = new URLSearchParams({
17
+ client_id: this.config.clientId,
18
+ client_secret: this.config.clientSecret,
19
+ code,
20
+ grant_type: 'authorization_code',
21
+ redirect_uri: redirectUri,
22
+ });
23
+ try {
24
+ const response = await fetch(this.tokenEndpoint, {
25
+ method: 'POST',
26
+ headers: {
27
+ 'Content-Type': 'application/x-www-form-urlencoded',
28
+ },
29
+ body: params.toString(),
30
+ });
31
+ if (!response.ok) {
32
+ const errorData = (await response.json());
33
+ throw new core_1.NAuthException(core_1.AuthErrorCode.SOCIAL_TOKEN_INVALID, `Token exchange failed: ${errorData.error_description || errorData.error}`);
34
+ }
35
+ const data = (await response.json());
36
+ return {
37
+ accessToken: data.access_token,
38
+ refreshToken: data.refresh_token,
39
+ expiresIn: data.expires_in,
40
+ };
41
+ }
42
+ catch (error) {
43
+ if (error instanceof Error) {
44
+ throw new core_1.NAuthException(core_1.AuthErrorCode.SOCIAL_TOKEN_INVALID, `Google token exchange failed: ${error.message}`);
45
+ }
46
+ throw new core_1.NAuthException(core_1.AuthErrorCode.SOCIAL_TOKEN_INVALID, 'Google token exchange failed: Unknown error');
47
+ }
48
+ }
49
+ async getUserProfile(accessToken) {
50
+ try {
51
+ const response = await fetch(this.userInfoEndpoint, {
52
+ headers: {
53
+ Authorization: `Bearer ${accessToken}`,
54
+ },
55
+ });
56
+ if (!response.ok) {
57
+ if (response.status === 401) {
58
+ throw new core_1.NAuthException(core_1.AuthErrorCode.SOCIAL_TOKEN_INVALID, 'Invalid or expired access token');
59
+ }
60
+ throw new core_1.NAuthException(core_1.AuthErrorCode.INTERNAL_ERROR, `Google API call failed: ${response.status} ${response.statusText}`);
61
+ }
62
+ const data = (await response.json());
63
+ return {
64
+ id: data.id,
65
+ email: data.email || null,
66
+ firstName: data.given_name || null,
67
+ lastName: data.family_name || null,
68
+ picture: data.picture || null,
69
+ verified: data.verified_email || false,
70
+ raw: data,
71
+ };
72
+ }
73
+ catch (error) {
74
+ if (error instanceof Error) {
75
+ throw new core_1.NAuthException(core_1.AuthErrorCode.INTERNAL_ERROR, `Google profile fetch failed: ${error.message}`);
76
+ }
77
+ throw new core_1.NAuthException(core_1.AuthErrorCode.INTERNAL_ERROR, 'Google profile fetch failed: Unknown error');
78
+ }
79
+ }
80
+ getAuthorizationUrl(state) {
81
+ const params = new URLSearchParams({
82
+ client_id: this.config.clientId,
83
+ redirect_uri: this.config.redirectUri,
84
+ scope: this.config.scopes?.join(' ') || 'openid email profile',
85
+ response_type: 'code',
86
+ access_type: 'offline',
87
+ });
88
+ if (state) {
89
+ params.append('state', state);
90
+ }
91
+ return `https://accounts.google.com/o/oauth2/v2/auth?${params.toString()}`;
92
+ }
93
+ }
94
+ exports.GoogleOAuthClient = GoogleOAuthClient;
95
+ //# sourceMappingURL=google-oauth.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-oauth.client.js","sourceRoot":"","sources":["../../src/google-oauth.client.ts"],"names":[],"mappings":";;;AAAA,8CAAgH;AAqBhH,MAAa,iBAAiB;IACX,MAAM,CAAc;IACpB,aAAa,GAAG,qCAAqC,CAAC;IACtD,gBAAgB,GAAG,+CAA+C,CAAC;IAEpF,YAAY,MAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;YACtC,GAAG,MAAM;SACV,CAAC;IACJ,CAAC;IAgBD,KAAK,CAAC,oBAAoB,CACxB,IAAY,EACZ,WAAmB;QAMnB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;YACjC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC/B,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY;YACvC,IAAI;YACJ,UAAU,EAAE,oBAAoB;YAChC,YAAY,EAAE,WAAW;SAC1B,CAAC,CAAC;QAEH,IAAI,CAA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E,IAAI,CAAC,GAAG,CAAC,IAAI,sBAAsB;YAC9D,aAAa,EAAE,MAAM;YACrB,WAAW,EAAE,SAAS;SAGvB,CAAC,CAAC;QAEH,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,gDAAgD,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC7E,CAAC;CACF;AA3JD,8CA2JC"}
@@ -0,0 +1,16 @@
1
+ import { AuthService, SocialAuthService, ClientInfoService, NAuthConfig, NAuthLogger, OAuthUserProfile, ISocialAuthProviderService, ITokenVerifierService, PhoneVerificationService, BaseUser } from '@nauth-toolkit/core';
2
+ import { BaseSocialAuthProviderService, JwtService, SessionService, AuthChallengeHelperService, AuthAuditService, TrustedDeviceService } from '@nauth-toolkit/core/internal';
3
+ import { Repository } from 'typeorm';
4
+ export declare class GoogleSocialAuthService extends BaseSocialAuthProviderService implements ISocialAuthProviderService {
5
+ readonly providerName = "google";
6
+ private readonly oauthClient;
7
+ private readonly tokenVerifier;
8
+ constructor(config: NAuthConfig, logger: NAuthLogger, authService: AuthService, socialAuthService: SocialAuthService, jwtService: JwtService, sessionService: SessionService, challengeHelper: AuthChallengeHelperService, clientInfoService: ClientInfoService, stateStore: Map<string, {
9
+ timestamp: number;
10
+ provider: string;
11
+ }>, userRepository: Repository<BaseUser>, phoneVerificationService?: PhoneVerificationService, auditService?: AuthAuditService, trustedDeviceService?: TrustedDeviceService, tokenVerifier?: ITokenVerifierService);
12
+ getAuthUrl(state?: string): Promise<string>;
13
+ protected getOAuthProfile(code: string, _state: string): Promise<OAuthUserProfile>;
14
+ protected verifyNativeToken(idToken: string, _accessToken?: string, profileData?: unknown): Promise<OAuthUserProfile>;
15
+ }
16
+ //# sourceMappingURL=google-social-auth.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-social-auth.service.d.ts","sourceRoot":"","sources":["../../src/google-social-au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