Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web based self-invite #27

Open
bruntonspall opened this issue Jan 5, 2018 · 1 comment
Open

Web based self-invite #27

bruntonspall opened this issue Jan 5, 2018 · 1 comment

Comments

@bruntonspall
Copy link
Owner

The invite functionality could be triggered from a webpage, which asks for the users email address and if it matches the whitelist, then send the invite.

@bruntonspall
Copy link
Owner Author

At the moment, you can directly message the bot on slack and say "invite [email protected]" and it will either send an invite, or in this case, tell you that brunton-spall.co.uk is not whitelisted for an email invite and refuse.

The code at the moment hosts 2 very very simple pages, /users and /channels

The code to serve those is currently awful, and looks like this: https://github.com/bruntonspall/xgovslackbot/blob/master/app/slack_bot.js#L59

Anyway. that whole setup webserver should be migrated out to a standalone module. I'd double check, but I think botkit includes express, so we could use the features of express to setup routes properly and probably templates.
Then we create a route that accepts a GET on /, and points people to the signup page, a GET on /signup that shows an email address form, and a POST handler that accepts the response, does some input validation, and then passes the email to the invite function. The rest should just work as expected I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant