|
@@ -113,17 +113,25 @@ export class SlackCtrl {
|
|
|
|
|
|
|
|
// illegal state
|
|
// illegal state
|
|
|
// TODO: https://youtrack.weseek.co.jp/issue/GW-5543
|
|
// TODO: https://youtrack.weseek.co.jp/issue/GW-5543
|
|
|
- if (req.query.state === 'init') {
|
|
|
|
|
- throw new Error('illegal state');
|
|
|
|
|
|
|
+ if (req.query.state !== 'init') {
|
|
|
|
|
+ res.writeHead(500, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
|
|
|
+ res.end('<html>'
|
|
|
|
|
+ + '<head><meta name="viewport" content="width=device-width,initial-scale=1"></head>'
|
|
|
|
|
+ + '<body style="text-align:center; padding-top:20%;">'
|
|
|
|
|
+ + '<h1>Illegal state, try it again.</h1>'
|
|
|
|
|
+ + '<a href="/slack/install">'
|
|
|
|
|
+ + 'go to install page'
|
|
|
|
|
+ + '</a>'
|
|
|
|
|
+ + '</body></html>');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.installerService.installer.handleCallback(req, res, {
|
|
this.installerService.installer.handleCallback(req, res, {
|
|
|
// success: (installation, metadata, req, res) => {},
|
|
// success: (installation, metadata, req, res) => {},
|
|
|
failure: (error, installOptions, req, res) => {
|
|
failure: (error, installOptions, req, res) => {
|
|
|
res.writeHead(500, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
res.writeHead(500, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
|
- res.end('<html><head>'
|
|
|
|
|
- + '<meta name="viewport" content="width=device-width,initial-scale=1">'
|
|
|
|
|
- + '</head><body style="text-align:center; padding-top:20%;">'
|
|
|
|
|
|
|
+ res.end('<html>'
|
|
|
|
|
+ + '<head><meta name="viewport" content="width=device-width,initial-scale=1"></head>'
|
|
|
|
|
+ + '<body style="text-align:center; padding-top:20%;">'
|
|
|
+ '<h1>GROWI Bot installation failed</h1>'
|
|
+ '<h1>GROWI Bot installation failed</h1>'
|
|
|
+ '<p>Please contact administrators of your workspace</p>'
|
|
+ '<p>Please contact administrators of your workspace</p>'
|
|
|
+ 'Reference: <a href="https://slack.com/help/articles/222386767-Manage-app-installation-settings-for-your-workspace">'
|
|
+ 'Reference: <a href="https://slack.com/help/articles/222386767-Manage-app-installation-settings-for-your-workspace">'
|