bolt-js
bolt-js copied to clipboard
Customise HTML for "slack/oauth_redirect" page
Description
Similar to #982 is there a way to change the HTML for the "/slack/oauth_redirect" page? It current displays a page without styling, it would be great to have a way to customise this.

What type of issue is this? (place an x
in one of the [ ]
)
- [ ] bug
- [ ] enhancement (feature request)
- [x] question
- [ ] documentation related
- [ ] example code related
- [ ] testing related
- [ ] discussion
Requirements (place an x
in each of the [ ]
)
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Hey @j1mie !
This is possible, though kind of difficult to figure out from our docs - it is buried deep!
Check out the bolt-js docs on Authenticating with OAuth, scroll down to the bottom of this section where there is a collapsed "Customizing OAuth defaults". Expand this section and check out some of the options (as well as the example alongside the content). What you want to specify is installerOptions.callbackOptions.success
or installerOptions.callbackOptions.successAsync
. This lets you define a custom successful-oauth-redirect handler. This handler gets access to a res
parameter - which is the HTTP response that controls what the user sees at the end of the OAuth redirect. These are all features of the underlying @slack/oauth
package.
Some links that may be helpful:
- The API reference for the
@slack/oauth
package'sCallbackOptions
object. This is the shape of theinstallerOptions.callbackOptions
object you can pass into your Bolt App constructor. - Take a look at the code for the default "callback success" HTML response handler. This shows you how the default redirect-success page you provided a screenshot of is built and returned to the user. I think it would be a good template to follow to implement your own
success
orsuccessAsync
override.
Hope that's helpful.
Cheers!
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.
As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.
Thanks @filmaj! Just used your suggestion and worked great 🎉