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

Allow for account creation from the Discord bot. #300

Closed
daanbreur opened this issue Jul 24, 2024 · 2 comments
Closed

Allow for account creation from the Discord bot. #300

daanbreur opened this issue Jul 24, 2024 · 2 comments

Comments

@daanbreur
Copy link
Contributor

Situation:
You are in a Discord server and want to get access to the CTFNote, there is possibly a pin somewhere with the invitation code which you can use to get your own account. However, you aren't done yet. You then will have to manually link your account.

Proposed Solution:
What if there was a better and quicker way of making an account and syncing your account to your discord. For this I propose a command, for example /createaccount or /register (name to be determined). Which will create an one-time invitation link, which, after used will automatically link the Discord id to the just created user.

image

There is also an option that the Discord bot checks if the user has a specific role and only if they have this role allows to create their own account using this command.
This option can also be turned off using environment variables.

The one-time invitation links that can be created through the admin dashboard remain unchanged and will just create the account without any additional linking.

@daanbreur
Copy link
Contributor Author

Implementation idea is to modify the table that holds invitation links and add a optional discord_id field in.
Add an additional ctfnote_private.do_register() that takes an extra discord_id parameter. Modify ctfnote.register_with_token() to check whether the invitation has a discord_id or not and call the appropriate do_register() function

@JJ-8
Copy link
Collaborator

JJ-8 commented Aug 10, 2024

Fixed by #301

@JJ-8 JJ-8 closed this as completed Aug 10, 2024
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

2 participants