@aoberoi/passport-slack
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.3
@@ -147,6 +147,12 @@ /// <reference types="node" /> | ||
export interface SlackStrategyVerifyCallback { | ||
(req: IncomingMessage, info: SlackStrategyVerificationInfo, done: (err: Error, user: any) => void): void; | ||
(info: SlackStrategyVerificationInfo, done: (err: Error, user: any) => void): void; | ||
(info: SlackStrategyVerificationInfo, done: (err: Error | null | undefined, user: any) => void): void; | ||
} | ||
/** | ||
* The callback that asynchronously produces the value to be stored on `req.user`, `req.account`, or the customized | ||
* `options.assignProperty`. This form is used when the `passReqToCallback` option is true. | ||
*/ | ||
export interface SlackStrategyVerifyCallbackWithRequest { | ||
(req: IncomingMessage, info: SlackStrategyVerificationInfo, done: (err: Error | null | undefined, user: any) => void): void; | ||
} | ||
/** | ||
* An object that can be used to store and verify state between an authorization attempt by the application and the | ||
@@ -165,3 +171,3 @@ * incoming request after the authorization server redirects the user back to the application. | ||
*/ | ||
export declare class SlackStrategy extends OAuth2Strategy { | ||
export default class SlackStrategy extends OAuth2Strategy { | ||
private slack; | ||
@@ -171,3 +177,3 @@ /** | ||
*/ | ||
constructor(options: SlackStrategyOptions, verify: SlackStrategyVerifyCallback); | ||
constructor(options: SlackStrategyOptions, verify: SlackStrategyVerifyCallback | SlackStrategyVerifyCallbackWithRequest); | ||
/** | ||
@@ -174,0 +180,0 @@ * Retrieve user and team profile from Slack |
@@ -19,3 +19,6 @@ "use strict"; | ||
*/ | ||
constructor(options, verify) { | ||
constructor(options, | ||
// TODO: parameterize this on whehter passReqToCallback is true | ||
// TODO: parameterize `info` on the value of skipUserProfile | ||
verify) { | ||
if (!options.clientSecret) { | ||
@@ -86,3 +89,3 @@ throw new TypeError('SlackStrategy requires a clientSecret option'); | ||
} | ||
exports.SlackStrategy = SlackStrategy; | ||
exports.default = SlackStrategy; | ||
/** | ||
@@ -146,6 +149,8 @@ * Verify Wrapper | ||
if (!passReqToCallback) { | ||
verify(info, verified); | ||
const verifyWithoutReq = verify; | ||
verifyWithoutReq(info, verified); | ||
} | ||
else { | ||
verify(req, info, verified); | ||
const verifyWithReq = verify; | ||
verifyWithReq(req, info, verified); | ||
} | ||
@@ -152,0 +157,0 @@ }; |
{ | ||
"name": "@aoberoi/passport-slack", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.3", | ||
"description": "Slack authentication strategy for Passport", | ||
@@ -5,0 +5,0 @@ "main": "dist/strategy.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
28453
369
0