Skip to content

Commit 4e2e16e

Browse files
authored
Merge pull request #24 from bflorian/oauth-callback
Add ability to set OAuth handler
2 parents ba5b8ee + e2a74a1 commit 4e2e16e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/smart-app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ module.exports = class SmartApp {
169169
// Events //
170170
/// //////////
171171

172+
oauthHandler(callback) {
173+
this._oauthHandler = callback
174+
return this
175+
}
176+
172177
subscribedEventHandler(name, callback) {
173178
this._subscribedEventHandlers[name] = callback
174179
return this
@@ -306,7 +311,7 @@ module.exports = class SmartApp {
306311

307312
case 'OAUTH_CALLBACK': {
308313
this._log.event(evt)
309-
this._oauthHandler(context, evt.oauthData)
314+
this._oauthHandler(context, evt.oauthCallbackData)
310315
responder.respond({statusCode: 200, oAuthCallbackData: {}})
311316
break
312317
}

0 commit comments

Comments
 (0)