social-auth-unifier 0.0.1
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/README.md +98 -0
- package/dist/facebook/facebook-oauth.controller.d.ts +5 -0
- package/dist/facebook/facebook-oauth.controller.js +46 -0
- package/dist/facebook/facebook-oauth.controller.js.map +1 -0
- package/dist/facebook/facebook-oauth.strategy.d.ts +8 -0
- package/dist/facebook/facebook-oauth.strategy.js +48 -0
- package/dist/facebook/facebook-oauth.strategy.js.map +1 -0
- package/dist/github/github-oauth.controller.d.ts +5 -0
- package/dist/github/github-oauth.controller.js +46 -0
- package/dist/github/github-oauth.controller.js.map +1 -0
- package/dist/github/github-oauth.strategy.d.ts +8 -0
- package/dist/github/github-oauth.strategy.js +47 -0
- package/dist/github/github-oauth.strategy.js.map +1 -0
- package/dist/google/google-oauth.controller.d.ts +5 -0
- package/dist/google/google-oauth.controller.js +46 -0
- package/dist/google/google-oauth.controller.js.map +1 -0
- package/dist/google/google-oauth.strategy.d.ts +8 -0
- package/dist/google/google-oauth.strategy.js +47 -0
- package/dist/google/google-oauth.strategy.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/facebook-oauth-options.interface.d.ts +15 -0
- package/dist/interfaces/facebook-oauth-options.interface.js +3 -0
- package/dist/interfaces/facebook-oauth-options.interface.js.map +1 -0
- package/dist/interfaces/github-oauth-options.interface.d.ts +15 -0
- package/dist/interfaces/github-oauth-options.interface.js +3 -0
- package/dist/interfaces/github-oauth-options.interface.js.map +1 -0
- package/dist/interfaces/google-oauth-options.interface.d.ts +15 -0
- package/dist/interfaces/google-oauth-options.interface.js +3 -0
- package/dist/interfaces/google-oauth-options.interface.js.map +1 -0
- package/dist/interfaces/linkedin-oauth-options.interface.d.ts +15 -0
- package/dist/interfaces/linkedin-oauth-options.interface.js +3 -0
- package/dist/interfaces/linkedin-oauth-options.interface.js.map +1 -0
- package/dist/interfaces/twitter-oauth-options.interface.d.ts +15 -0
- package/dist/interfaces/twitter-oauth-options.interface.js +3 -0
- package/dist/interfaces/twitter-oauth-options.interface.js.map +1 -0
- package/dist/linkedin/linkedin-oauth.controller.d.ts +5 -0
- package/dist/linkedin/linkedin-oauth.controller.js +46 -0
- package/dist/linkedin/linkedin-oauth.controller.js.map +1 -0
- package/dist/linkedin/linkedin-oauth.strategy.d.ts +8 -0
- package/dist/linkedin/linkedin-oauth.strategy.js +47 -0
- package/dist/linkedin/linkedin-oauth.strategy.js.map +1 -0
- package/dist/session.serializer.d.ts +5 -0
- package/dist/session.serializer.js +24 -0
- package/dist/session.serializer.js.map +1 -0
- package/dist/social-auth.module.d.ts +5 -0
- package/dist/social-auth.module.js +136 -0
- package/dist/social-auth.module.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/twitter/twitter-oauth.controller.d.ts +5 -0
- package/dist/twitter/twitter-oauth.controller.js +46 -0
- package/dist/twitter/twitter-oauth.controller.js.map +1 -0
- package/dist/twitter/twitter-oauth.strategy.d.ts +8 -0
- package/dist/twitter/twitter-oauth.strategy.js +48 -0
- package/dist/twitter/twitter-oauth.strategy.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# social-auth-unifier
|
|
2
|
+
|
|
3
|
+
[Passport](http://passportjs.org/) strategies for authenticating with Google, Twitter, Facebook, LinkedIn, and GitHub using OAuth 2.0, all unifed in a single NestJS module.
|
|
4
|
+
|
|
5
|
+
This module lets you authenticate using multiple social providers in your Node.js applications. By plugging into [Passport](http://passportjs.org/), social authentication can be easily and unobtrusively integrated into any application or framework that supports [Connect](http://www.senchalabs.org/connect/)-style middleware, including [Express](http://expressjs.com/) and [NestJS](https://nestjs.com/).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ npm install social-auth-unifier
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
#### Configure Strategy
|
|
16
|
+
|
|
17
|
+
The unified strategy authenticates users using a client ID and client secret, which are obtained by creating an application at the respective developer portals (e.g., [Google Cloud Console](https://console.cloud.google.com/), [Twitter Developer Portal](https://developer.twitter.com/)). The client ID and secret are supplied as environment variables.
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { Module } from '@nestjs/common';
|
|
21
|
+
import { SocialAuthModule } from 'social-auth-unifier';
|
|
22
|
+
|
|
23
|
+
@Module({
|
|
24
|
+
imports: [
|
|
25
|
+
// Register the module. It will automatically read from process.env
|
|
26
|
+
SocialAuthModule.register(),
|
|
27
|
+
],
|
|
28
|
+
})
|
|
29
|
+
export class AppModule {}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Environment Variables
|
|
33
|
+
|
|
34
|
+
The module automatically detects and configures enabled providers based on the presence of these environment variables:
|
|
35
|
+
|
|
36
|
+
```dotenv
|
|
37
|
+
# Google
|
|
38
|
+
GOOGLE_AUTH=true
|
|
39
|
+
GOOGLE_CLIENT_ID=your-google-client-id
|
|
40
|
+
GOOGLE_CLIENT_SECRET=your-google-client-secret
|
|
41
|
+
GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/redirect
|
|
42
|
+
|
|
43
|
+
# Twitter
|
|
44
|
+
TWITTER_AUTH=true
|
|
45
|
+
TWITTER_CLIENT_ID=your-twitter-client-id
|
|
46
|
+
TWITTER_CLIENT_SECRET=your-twitter-client-secret
|
|
47
|
+
TWITTER_CALLBACK_URL=http://localhost:3000/auth/twitter/redirect
|
|
48
|
+
|
|
49
|
+
# Facebook
|
|
50
|
+
FACEBOOK_AUTH=true
|
|
51
|
+
FACEBOOK_CLIENT_ID=your-facebook-client-id
|
|
52
|
+
FACEBOOK_CLIENT_SECRET=your-facebook-client-secret
|
|
53
|
+
FACEBOOK_CALLBACK_URL=http://localhost:3000/auth/facebook/redirect
|
|
54
|
+
|
|
55
|
+
# LinkedIn
|
|
56
|
+
LINKEDIN_AUTH=true
|
|
57
|
+
LINKEDIN_CLIENT_ID=your-linkedin-client-id
|
|
58
|
+
LINKEDIN_CLIENT_SECRET=your-linkedin-client-secret
|
|
59
|
+
LINKEDIN_CALLBACK_URL=http://localhost:3000/auth/linkedin/redirect
|
|
60
|
+
|
|
61
|
+
# GitHub
|
|
62
|
+
GITHUB_AUTH=true
|
|
63
|
+
GITHUB_CLIENT_ID=your-github-client-id
|
|
64
|
+
GITHUB_CLIENT_SECRET=your-github-client-secret
|
|
65
|
+
GITHUB_CALLBACK_URL=http://localhost:3000/auth/github/redirect
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### Authenticate Requests
|
|
69
|
+
|
|
70
|
+
Use the built-in routes to initiate authentication. The module automatically registers controllers for enabled strategies.
|
|
71
|
+
|
|
72
|
+
- **Google**: `GET /auth/google`
|
|
73
|
+
- **Twitter**: `GET /auth/twitter`
|
|
74
|
+
- **Facebook**: `GET /auth/facebook`
|
|
75
|
+
- **LinkedIn**: `GET /auth/linkedin`
|
|
76
|
+
- **GitHub**: `GET /auth/github`
|
|
77
|
+
|
|
78
|
+
For example, to log in with GitHub, simply link to:
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<a href="/auth/github">Login with GitHub</a>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
[MIT](LICENSE)
|
|
87
|
+
|
|
88
|
+
## Author
|
|
89
|
+
|
|
90
|
+
- **Mirza Saikat Ahmmed**
|
|
91
|
+
- Website: [saikat.com.bd](https://saikat.com.bd)
|
|
92
|
+
- Email: contact@saikat.com.bd
|
|
93
|
+
|
|
94
|
+
## Repository
|
|
95
|
+
|
|
96
|
+
- GitHub: [https://github.com/mirzasaikatahmmed](https://github.com/mirzasaikatahmmed)
|
|
97
|
+
- Project Link: [https://github.com/mirzasaikatahmmed/social-auth-unifier](https://github.com/mirzasaikatahmmed/social-auth-unifier)
|
|
98
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.FacebookOauthController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const passport_1 = require("@nestjs/passport");
|
|
18
|
+
let FacebookOauthController = class FacebookOauthController {
|
|
19
|
+
async facebookAuth(_req) {
|
|
20
|
+
}
|
|
21
|
+
async facebookAuthRedirect(req, res) {
|
|
22
|
+
res.json(req.user);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.FacebookOauthController = FacebookOauthController;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, common_1.Get)(),
|
|
28
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)('facebook')),
|
|
29
|
+
__param(0, (0, common_1.Req)()),
|
|
30
|
+
__metadata("design:type", Function),
|
|
31
|
+
__metadata("design:paramtypes", [Object]),
|
|
32
|
+
__metadata("design:returntype", Promise)
|
|
33
|
+
], FacebookOauthController.prototype, "facebookAuth", null);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, common_1.Get)('redirect'),
|
|
36
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)('facebook')),
|
|
37
|
+
__param(0, (0, common_1.Req)()),
|
|
38
|
+
__param(1, (0, common_1.Res)()),
|
|
39
|
+
__metadata("design:type", Function),
|
|
40
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
41
|
+
__metadata("design:returntype", Promise)
|
|
42
|
+
], FacebookOauthController.prototype, "facebookAuthRedirect", null);
|
|
43
|
+
exports.FacebookOauthController = FacebookOauthController = __decorate([
|
|
44
|
+
(0, common_1.Controller)('auth/facebook')
|
|
45
|
+
], FacebookOauthController);
|
|
46
|
+
//# sourceMappingURL=facebook-oauth.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facebook-oauth.controller.js","sourceRoot":"","sources":["../../src/facebook/facebook-oauth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsE;AAEtE,+CAA6C;AAGtC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAG1B,AAAN,KAAK,CAAC,YAAY,CAAQ,IAAS;IAEnC,CAAC;IAIK,AAAN,KAAK,CAAC,oBAAoB,CAAQ,GAAY,EAAS,GAAa;QAChE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;CACJ,CAAA;AAZY,0DAAuB;AAG1B;IAFL,IAAA,YAAG,GAAE;IACL,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,UAAU,CAAC,CAAC;IACb,WAAA,IAAA,YAAG,GAAE,CAAA;;;;2DAExB;AAIK;IAFL,IAAA,YAAG,EAAC,UAAU,CAAC;IACf,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,UAAU,CAAC,CAAC;IACL,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;mEAErD;kCAXQ,uBAAuB;IADnC,IAAA,mBAAU,EAAC,eAAe,CAAC;GACf,uBAAuB,CAYnC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Strategy } from 'passport-facebook';
|
|
2
|
+
import { FacebookOauthOptions } from '../interfaces/facebook-oauth-options.interface';
|
|
3
|
+
declare const FacebookOauthStrategy_base: new (...args: any[]) => Strategy;
|
|
4
|
+
export declare class FacebookOauthStrategy extends FacebookOauthStrategy_base {
|
|
5
|
+
constructor(options: FacebookOauthOptions);
|
|
6
|
+
validate(accessToken: string, refreshToken: string, profile: any, done: (err: any, user: any, info?: any) => void): Promise<any>;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.FacebookOauthStrategy = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const passport_1 = require("@nestjs/passport");
|
|
18
|
+
const passport_facebook_1 = require("passport-facebook");
|
|
19
|
+
let FacebookOauthStrategy = class FacebookOauthStrategy extends (0, passport_1.PassportStrategy)(passport_facebook_1.Strategy, 'facebook') {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
super({
|
|
22
|
+
clientID: options.clientId,
|
|
23
|
+
clientSecret: options.clientSecret,
|
|
24
|
+
callbackURL: options.callbackUrl,
|
|
25
|
+
scope: ['email', 'public_profile'],
|
|
26
|
+
profileFields: ['id', 'displayName', 'photos', 'email'],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async validate(accessToken, refreshToken, profile, done) {
|
|
30
|
+
const { name, emails, photos } = profile;
|
|
31
|
+
const user = {
|
|
32
|
+
email: emails ? emails[0].value : null,
|
|
33
|
+
firstName: name.givenName,
|
|
34
|
+
lastName: name.familyName,
|
|
35
|
+
picture: photos ? photos[0].value : null,
|
|
36
|
+
accessToken,
|
|
37
|
+
profile,
|
|
38
|
+
};
|
|
39
|
+
done(null, user);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.FacebookOauthStrategy = FacebookOauthStrategy;
|
|
43
|
+
exports.FacebookOauthStrategy = FacebookOauthStrategy = __decorate([
|
|
44
|
+
(0, common_1.Injectable)(),
|
|
45
|
+
__param(0, (0, common_1.Inject)('FACEBOOK_OAUTH_OPTIONS')),
|
|
46
|
+
__metadata("design:paramtypes", [Object])
|
|
47
|
+
], FacebookOauthStrategy);
|
|
48
|
+
//# sourceMappingURL=facebook-oauth.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facebook-oauth.strategy.js","sourceRoot":"","sources":["../../src/facebook/facebook-oauth.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,+CAAoD;AACpD,yDAA6C;AAItC,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,IAAA,2BAAgB,EAAC,4BAAQ,EAAE,UAAU,CAAC;IAC7E,YACsC,OAA6B;QAE/D,KAAK,CAAC;YACF,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,KAAK,EAAE,CAAC,OAAO,EAAE,gBAAgB,CAAC;YAClC,aAAa,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC;SAC1D,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,QAAQ,CACV,WAAmB,EACnB,YAAoB,EACpB,OAAY,EACZ,IAA+C;QAE/C,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QACzC,MAAM,IAAI,GAAG;YACT,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;YACtC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,UAAU;YACzB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;YACxC,WAAW;YACX,OAAO;SACV,CAAC;QAEF,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrB,CAAC;CACJ,CAAA;AA/BY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;IAGJ,WAAA,IAAA,eAAM,EAAC,wBAAwB,CAAC,CAAA;;GAF5B,qBAAqB,CA+BjC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GithubOauthController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const passport_1 = require("@nestjs/passport");
|
|
18
|
+
let GithubOauthController = class GithubOauthController {
|
|
19
|
+
async githubAuth(_req) {
|
|
20
|
+
}
|
|
21
|
+
async githubAuthRedirect(req, res) {
|
|
22
|
+
res.json(req.user);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.GithubOauthController = GithubOauthController;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, common_1.Get)(),
|
|
28
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)('github')),
|
|
29
|
+
__param(0, (0, common_1.Req)()),
|
|
30
|
+
__metadata("design:type", Function),
|
|
31
|
+
__metadata("design:paramtypes", [Object]),
|
|
32
|
+
__metadata("design:returntype", Promise)
|
|
33
|
+
], GithubOauthController.prototype, "githubAuth", null);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, common_1.Get)('redirect'),
|
|
36
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)('github')),
|
|
37
|
+
__param(0, (0, common_1.Req)()),
|
|
38
|
+
__param(1, (0, common_1.Res)()),
|
|
39
|
+
__metadata("design:type", Function),
|
|
40
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
41
|
+
__metadata("design:returntype", Promise)
|
|
42
|
+
], GithubOauthController.prototype, "githubAuthRedirect", null);
|
|
43
|
+
exports.GithubOauthController = GithubOauthController = __decorate([
|
|
44
|
+
(0, common_1.Controller)('auth/github')
|
|
45
|
+
], GithubOauthController);
|
|
46
|
+
//# sourceMappingURL=github-oauth.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-oauth.controller.js","sourceRoot":"","sources":["../../src/github/github-oauth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsE;AAEtE,+CAA6C;AAGtC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAGxB,AAAN,KAAK,CAAC,UAAU,CAAQ,IAAS;IAEjC,CAAC;IAIK,AAAN,KAAK,CAAC,kBAAkB,CAAQ,GAAY,EAAS,GAAa;QAC9D,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;CACJ,CAAA;AAZY,sDAAqB;AAGxB;IAFL,IAAA,YAAG,GAAE;IACL,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC;IACb,WAAA,IAAA,YAAG,GAAE,CAAA;;;;uDAEtB;AAIK;IAFL,IAAA,YAAG,EAAC,UAAU,CAAC;IACf,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC;IACL,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;+DAEnD;gCAXQ,qBAAqB;IADjC,IAAA,mBAAU,EAAC,aAAa,CAAC;GACb,qBAAqB,CAYjC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Strategy } from 'passport-github2';
|
|
2
|
+
import { GithubOauthOptions } from '../interfaces/github-oauth-options.interface';
|
|
3
|
+
declare const GithubOauthStrategy_base: new (...args: any[]) => Strategy;
|
|
4
|
+
export declare class GithubOauthStrategy extends GithubOauthStrategy_base {
|
|
5
|
+
constructor(options: GithubOauthOptions);
|
|
6
|
+
validate(accessToken: string, refreshToken: string, profile: any, done: (err: any, user: any, info?: any) => void): Promise<any>;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GithubOauthStrategy = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const passport_1 = require("@nestjs/passport");
|
|
18
|
+
const passport_github2_1 = require("passport-github2");
|
|
19
|
+
let GithubOauthStrategy = class GithubOauthStrategy extends (0, passport_1.PassportStrategy)(passport_github2_1.Strategy, 'github') {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
super({
|
|
22
|
+
clientID: options.clientId,
|
|
23
|
+
clientSecret: options.clientSecret,
|
|
24
|
+
callbackURL: options.callbackUrl,
|
|
25
|
+
scope: ['user:email'],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
async validate(accessToken, refreshToken, profile, done) {
|
|
29
|
+
const { displayName, emails, photos, username } = profile;
|
|
30
|
+
const user = {
|
|
31
|
+
email: emails ? emails[0].value : null,
|
|
32
|
+
firstName: displayName ? displayName.split(' ')[0] : username,
|
|
33
|
+
lastName: displayName && displayName.split(' ').length > 1 ? displayName.split(' ').slice(1).join(' ') : '',
|
|
34
|
+
picture: photos ? photos[0].value : null,
|
|
35
|
+
accessToken,
|
|
36
|
+
profile,
|
|
37
|
+
};
|
|
38
|
+
done(null, user);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.GithubOauthStrategy = GithubOauthStrategy;
|
|
42
|
+
exports.GithubOauthStrategy = GithubOauthStrategy = __decorate([
|
|
43
|
+
(0, common_1.Injectable)(),
|
|
44
|
+
__param(0, (0, common_1.Inject)('GITHUB_OAUTH_OPTIONS')),
|
|
45
|
+
__metadata("design:paramtypes", [Object])
|
|
46
|
+
], GithubOauthStrategy);
|
|
47
|
+
//# sourceMappingURL=github-oauth.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-oauth.strategy.js","sourceRoot":"","sources":["../../src/github/github-oauth.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,+CAAoD;AACpD,uDAA4C;AAIrC,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,IAAA,2BAAgB,EAAC,2BAAQ,EAAE,QAAQ,CAAC;IACzE,YACoC,OAA2B;QAE3D,KAAK,CAAC;YACF,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,KAAK,EAAE,CAAC,YAAY,CAAC;SACxB,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,QAAQ,CACV,WAAmB,EACnB,YAAoB,EACpB,OAAY,EACZ,IAA+C;QAE/C,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAC1D,MAAM,IAAI,GAAG;YACT,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;YACtC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ;YAC7D,QAAQ,EAAE,WAAW,IAAI,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;YAC3G,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;YACxC,WAAW;YACX,OAAO;SACV,CAAC;QAEF,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrB,CAAC;CACJ,CAAA;AA9BY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGJ,WAAA,IAAA,eAAM,EAAC,sBAAsB,CAAC,CAAA;;GAF1B,mBAAmB,CA8B/B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GoogleOauthController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const passport_1 = require("@nestjs/passport");
|
|
18
|
+
let GoogleOauthController = class GoogleOauthController {
|
|
19
|
+
async googleAuth(_req) {
|
|
20
|
+
}
|
|
21
|
+
async googleAuthRedirect(req, res) {
|
|
22
|
+
res.json(req.user);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.GoogleOauthController = GoogleOauthController;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, common_1.Get)(),
|
|
28
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)('google')),
|
|
29
|
+
__param(0, (0, common_1.Req)()),
|
|
30
|
+
__metadata("design:type", Function),
|
|
31
|
+
__metadata("design:paramtypes", [Object]),
|
|
32
|
+
__metadata("design:returntype", Promise)
|
|
33
|
+
], GoogleOauthController.prototype, "googleAuth", null);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, common_1.Get)('redirect'),
|
|
36
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)('google')),
|
|
37
|
+
__param(0, (0, common_1.Req)()),
|
|
38
|
+
__param(1, (0, common_1.Res)()),
|
|
39
|
+
__metadata("design:type", Function),
|
|
40
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
41
|
+
__metadata("design:returntype", Promise)
|
|
42
|
+
], GoogleOauthController.prototype, "googleAuthRedirect", null);
|
|
43
|
+
exports.GoogleOauthController = GoogleOauthController = __decorate([
|
|
44
|
+
(0, common_1.Controller)('auth/google')
|
|
45
|
+
], GoogleOauthController);
|
|
46
|
+
//# sourceMappingURL=google-oauth.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-oauth.controller.js","sourceRoot":"","sources":["../../src/google/google-oauth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsE;AAEtE,+CAA6C;AAGtC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAGxB,AAAN,KAAK,CAAC,UAAU,CAAQ,IAAS;IAEjC,CAAC;IAIK,AAAN,KAAK,CAAC,kBAAkB,CAAQ,GAAY,EAAS,GAAa;QAG9D,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;CACJ,CAAA;AAdY,sDAAqB;AAGxB;IAFL,IAAA,YAAG,GAAE;IACL,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC;IACb,WAAA,IAAA,YAAG,GAAE,CAAA;;;;uDAEtB;AAIK;IAFL,IAAA,YAAG,EAAC,UAAU,CAAC;IACf,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC;IACL,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;+DAInD;gCAbQ,qBAAqB;IADjC,IAAA,mBAAU,EAAC,aAAa,CAAC;GACb,qBAAqB,CAcjC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Strategy, VerifyCallback } from 'passport-google-oauth20';
|
|
2
|
+
import { GoogleOauthOptions } from '../interfaces/google-oauth-options.interface';
|
|
3
|
+
declare const GoogleOauthStrategy_base: new (...args: any[]) => Strategy;
|
|
4
|
+
export declare class GoogleOauthStrategy extends GoogleOauthStrategy_base {
|
|
5
|
+
constructor(options: GoogleOauthOptions);
|
|
6
|
+
validate(accessToken: string, refreshToken: string, profile: any, done: VerifyCallback): Promise<any>;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GoogleOauthStrategy = void 0;
|
|
16
|
+
const passport_1 = require("@nestjs/passport");
|
|
17
|
+
const passport_google_oauth20_1 = require("passport-google-oauth20");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
let GoogleOauthStrategy = class GoogleOauthStrategy extends (0, passport_1.PassportStrategy)(passport_google_oauth20_1.Strategy, 'google') {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
super({
|
|
22
|
+
clientID: options.clientId,
|
|
23
|
+
clientSecret: options.clientSecret,
|
|
24
|
+
callbackURL: options.callbackUrl,
|
|
25
|
+
scope: ['email', 'profile'],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
async validate(accessToken, refreshToken, profile, done) {
|
|
29
|
+
const { name, emails, photos } = profile;
|
|
30
|
+
const user = {
|
|
31
|
+
email: emails[0].value,
|
|
32
|
+
firstName: name.givenName,
|
|
33
|
+
lastName: name.familyName,
|
|
34
|
+
picture: photos[0].value,
|
|
35
|
+
accessToken,
|
|
36
|
+
};
|
|
37
|
+
console.log(user);
|
|
38
|
+
done(null, user);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.GoogleOauthStrategy = GoogleOauthStrategy;
|
|
42
|
+
exports.GoogleOauthStrategy = GoogleOauthStrategy = __decorate([
|
|
43
|
+
(0, common_1.Injectable)(),
|
|
44
|
+
__param(0, (0, common_1.Inject)('GOOGLE_OAUTH_OPTIONS')),
|
|
45
|
+
__metadata("design:paramtypes", [Object])
|
|
46
|
+
], GoogleOauthStrategy);
|
|
47
|
+
//# sourceMappingURL=google-oauth.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-oauth.strategy.js","sourceRoot":"","sources":["../../src/google/google-oauth.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qEAAmE;AACnE,2CAAoD;AAI7C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,IAAA,2BAAgB,EAAC,kCAAQ,EAAE,QAAQ,CAAC;IACzE,YAA4C,OAA2B;QACnE,KAAK,CAAC;YACF,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;SAC9B,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,QAAQ,CACV,WAAmB,EACnB,YAAoB,EACpB,OAAY,EACZ,IAAoB;QAEpB,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QACzC,MAAM,IAAI,GAAG;YACT,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK;YACtB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,UAAU;YACzB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK;YACxB,WAAW;SACd,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrB,CAAC;CACJ,CAAA;AA3BY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAEI,WAAA,IAAA,eAAM,EAAC,sBAAsB,CAAC,CAAA;;GADlC,mBAAmB,CA2B/B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './social-auth.module';
|
|
2
|
+
export * from './session.serializer';
|
|
3
|
+
export * from './interfaces/google-oauth-options.interface';
|
|
4
|
+
export * from './interfaces/twitter-oauth-options.interface';
|
|
5
|
+
export * from './google/google-oauth.strategy';
|
|
6
|
+
export * from './google/google-oauth.controller';
|
|
7
|
+
export * from './twitter/twitter-oauth.strategy';
|
|
8
|
+
export * from './twitter/twitter-oauth.controller';
|
package/dist/index.js
ADDED
|
@@ -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
|
+
__exportStar(require("./social-auth.module"), exports);
|
|
18
|
+
__exportStar(require("./session.serializer"), exports);
|
|
19
|
+
__exportStar(require("./interfaces/google-oauth-options.interface"), exports);
|
|
20
|
+
__exportStar(require("./interfaces/twitter-oauth-options.interface"), exports);
|
|
21
|
+
__exportStar(require("./google/google-oauth.strategy"), exports);
|
|
22
|
+
__exportStar(require("./google/google-oauth.controller"), exports);
|
|
23
|
+
__exportStar(require("./twitter/twitter-oauth.strategy"), exports);
|
|
24
|
+
__exportStar(require("./twitter/twitter-oauth.controller"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,uDAAqC;AACrC,8EAA4D;AAC5D,+EAA6D;AAC7D,iEAA+C;AAC/C,mEAAiD;AACjD,mEAAiD;AACjD,qEAAmD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
export interface FacebookOauthOptions {
|
|
3
|
+
clientId: string;
|
|
4
|
+
clientSecret: string;
|
|
5
|
+
callbackUrl: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FacebookOauthOptionsFactory {
|
|
8
|
+
createFacebookOauthOptions(): Promise<FacebookOauthOptions> | FacebookOauthOptions;
|
|
9
|
+
}
|
|
10
|
+
export interface FacebookOauthAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
11
|
+
useExisting?: Type<FacebookOauthOptionsFactory>;
|
|
12
|
+
useClass?: Type<FacebookOauthOptionsFactory>;
|
|
13
|
+
useFactory?: (...args: any[]) => Promise<FacebookOauthOptions> | FacebookOauthOptions;
|
|
14
|
+
inject?: any[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facebook-oauth-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/facebook-oauth-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
export interface GithubOauthOptions {
|
|
3
|
+
clientId: string;
|
|
4
|
+
clientSecret: string;
|
|
5
|
+
callbackUrl: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GithubOauthOptionsFactory {
|
|
8
|
+
createGithubOauthOptions(): Promise<GithubOauthOptions> | GithubOauthOptions;
|
|
9
|
+
}
|
|
10
|
+
export interface GithubOauthAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
11
|
+
useExisting?: Type<GithubOauthOptionsFactory>;
|
|
12
|
+
useClass?: Type<GithubOauthOptionsFactory>;
|
|
13
|
+
useFactory?: (...args: any[]) => Promise<GithubOauthOptions> | GithubOauthOptions;
|
|
14
|
+
inject?: any[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-oauth-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/github-oauth-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
export interface GoogleOauthOptions {
|
|
3
|
+
clientId: string;
|
|
4
|
+
clientSecret: string;
|
|
5
|
+
callbackUrl: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GoogleOauthOptionsFactory {
|
|
8
|
+
createGoogleOauthOptions(): Promise<GoogleOauthOptions> | GoogleOauthOptions;
|
|
9
|
+
}
|
|
10
|
+
export interface GoogleOauthAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
11
|
+
useExisting?: Type<GoogleOauthOptionsFactory>;
|
|
12
|
+
useClass?: Type<GoogleOauthOptionsFactory>;
|
|
13
|
+
useFactory?: (...args: any[]) => Promise<GoogleOauthOptions> | GoogleOauthOptions;
|
|
14
|
+
inject?: any[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-oauth-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/google-oauth-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
export interface LinkedinOauthOptions {
|
|
3
|
+
clientId: string;
|
|
4
|
+
clientSecret: string;
|
|
5
|
+
callbackUrl: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LinkedinOauthOptionsFactory {
|
|
8
|
+
createLinkedinOauthOptions(): Promise<LinkedinOauthOptions> | LinkedinOauthOptions;
|
|
9
|
+
}
|
|
10
|
+
export interface LinkedinOauthAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
11
|
+
useExisting?: Type<LinkedinOauthOptionsFactory>;
|
|
12
|
+
useClass?: Type<LinkedinOauthOptionsFactory>;
|
|
13
|
+
useFactory?: (...args: any[]) => Promise<LinkedinOauthOptions> | LinkedinOauthOptions;
|
|
14
|
+
inject?: any[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkedin-oauth-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/linkedin-oauth-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
export interface TwitterOauthOptions {
|
|
3
|
+
clientId: string;
|
|
4
|
+
clientSecret: string;
|
|
5
|
+
callbackUrl: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TwitterOauthOptionsFactory {
|
|
8
|
+
createTwitterOauthOptions(): Promise<TwitterOauthOptions> | TwitterOauthOptions;
|
|
9
|
+
}
|
|
10
|
+
export interface TwitterOauthAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
11
|
+
useExisting?: Type<TwitterOauthOptionsFactory>;
|
|
12
|
+
useClass?: Type<TwitterOauthOptionsFactory>;
|
|
13
|
+
useFactory?: (...args: any[]) => Promise<TwitterOauthOptions> | TwitterOauthOptions;
|
|
14
|
+
inject?: any[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twitter-oauth-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/twitter-oauth-options.interface.ts"],"names":[],"mappings":""}
|