@nauth-toolkit/social-google 0.1.26 → 0.1.28
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/dist/nestjs/google-social-auth.module.d.ts +1 -13
- package/dist/nestjs/google-social-auth.module.d.ts.map +1 -1
- package/dist/nestjs/google-social-auth.module.js +6 -27
- package/dist/nestjs/google-social-auth.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -2
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { GoogleSocialAuthService } from '../src/google-social-auth.service';
|
|
3
|
-
import { SocialProviderRegistry } from '@nauth-toolkit/core/internal';
|
|
4
1
|
/**
|
|
5
2
|
* Google Social Authentication Module (NestJS Adapter)
|
|
6
3
|
*
|
|
@@ -34,15 +31,6 @@ import { SocialProviderRegistry } from '@nauth-toolkit/core/internal';
|
|
|
34
31
|
* constructor(private googleAuth: GoogleSocialAuthService) {}
|
|
35
32
|
* ```
|
|
36
33
|
*/
|
|
37
|
-
export declare class GoogleSocialAuthModule
|
|
38
|
-
private readonly googleSocialAuthService;
|
|
39
|
-
private readonly providerRegistry;
|
|
40
|
-
constructor(googleSocialAuthService: GoogleSocialAuthService, providerRegistry: SocialProviderRegistry);
|
|
41
|
-
/**
|
|
42
|
-
* Auto-register Google provider with the SocialProviderRegistry
|
|
43
|
-
* when the module is initialized.
|
|
44
|
-
* Only registers if the provider is enabled in config.
|
|
45
|
-
*/
|
|
46
|
-
onModuleInit(): void;
|
|
34
|
+
export declare class GoogleSocialAuthModule {
|
|
47
35
|
}
|
|
48
36
|
//# sourceMappingURL=google-social-auth.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-social-auth.module.d.ts","sourceRoot":"","sources":["../../nestjs/google-social-auth.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"google-social-auth.module.d.ts","sourceRoot":"","sources":["../../nestjs/google-social-auth.module.ts"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBA4Ea,sBAAsB;CAAG"}
|
|
@@ -5,9 +5,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
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
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
9
|
exports.GoogleSocialAuthModule = void 0;
|
|
13
10
|
const common_1 = require("@nestjs/common");
|
|
@@ -51,27 +48,6 @@ const token_verifier_service_1 = require("../src/token-verifier.service");
|
|
|
51
48
|
* ```
|
|
52
49
|
*/
|
|
53
50
|
let GoogleSocialAuthModule = class GoogleSocialAuthModule {
|
|
54
|
-
googleSocialAuthService;
|
|
55
|
-
providerRegistry;
|
|
56
|
-
constructor(googleSocialAuthService, providerRegistry) {
|
|
57
|
-
this.googleSocialAuthService = googleSocialAuthService;
|
|
58
|
-
this.providerRegistry = providerRegistry;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Auto-register Google provider with the SocialProviderRegistry
|
|
62
|
-
* when the module is initialized.
|
|
63
|
-
* Only registers if the provider is enabled in config.
|
|
64
|
-
*/
|
|
65
|
-
onModuleInit() {
|
|
66
|
-
// Check if provider is enabled by checking if oauthClient was initialized
|
|
67
|
-
// Service sets oauthClient to null when disabled
|
|
68
|
-
const config = this.googleSocialAuthService['config'];
|
|
69
|
-
const providerConfig = config.social?.google;
|
|
70
|
-
if (providerConfig?.enabled) {
|
|
71
|
-
this.providerRegistry.registerProvider(this.googleSocialAuthService);
|
|
72
|
-
}
|
|
73
|
-
// If disabled, silently skip registration - module can exist but provider won't be available
|
|
74
|
-
}
|
|
75
51
|
};
|
|
76
52
|
exports.GoogleSocialAuthModule = GoogleSocialAuthModule;
|
|
77
53
|
exports.GoogleSocialAuthModule = GoogleSocialAuthModule = __decorate([
|
|
@@ -114,10 +90,13 @@ exports.GoogleSocialAuthModule = GoogleSocialAuthModule = __decorate([
|
|
|
114
90
|
{ token: 'GOOGLE_TOKEN_VERIFIER', optional: true },
|
|
115
91
|
],
|
|
116
92
|
},
|
|
93
|
+
// Bind to shared discovery token (registration is performed by AuthModule at app bootstrap)
|
|
94
|
+
{
|
|
95
|
+
provide: internal_1.NAUTH_SOCIAL_PROVIDER_TOKEN,
|
|
96
|
+
useExisting: google_social_auth_service_1.GoogleSocialAuthService,
|
|
97
|
+
},
|
|
117
98
|
],
|
|
118
99
|
exports: [google_social_auth_service_1.GoogleSocialAuthService],
|
|
119
|
-
})
|
|
120
|
-
__metadata("design:paramtypes", [google_social_auth_service_1.GoogleSocialAuthService,
|
|
121
|
-
internal_1.SocialProviderRegistry])
|
|
100
|
+
})
|
|
122
101
|
], GoogleSocialAuthModule);
|
|
123
102
|
//# sourceMappingURL=google-social-auth.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-social-auth.module.js","sourceRoot":"","sources":["../../nestjs/google-social-auth.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"google-social-auth.module.js","sourceRoot":"","sources":["../../nestjs/google-social-auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,kFAA4E;AAC5E,qBAAqB;AACrB,8CAS6B;AAC7B,sDAAsD;AACtD,2DAOsC;AACtC,0EAAmG;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AA6EI,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAAG,CAAA;AAAzB,wD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