guys, here I just give a simple example,
I use the Android platform, with the aim of being like iOS, desktop
You can make sure this file runs well
There are many ways that can be used to create Discord authorization
for example on the page another example.
but back again to my goal, creating a file like this I hope you all like it
thank you and good luck trying it
Maybe most Discord bot developers need a dashboard, and need several other needs such as creating a website for their bot,However, they also need permission to access photos, IDs and names from the Discord account they use, or other things such as requiring guild access, email or whatever depending on their goals.
- nodejs v16 or the latest version
- express
- axios
- node-fetch
required
automatic installation
clone this project with an example like this on your terminal
git clone https://github.com/Drnk-28/discord-auth-example.git
after that, you can manage everything starting from this
after that run it with node .
on your terminal
manual installation
You can download this repository on the main page of this repository
After that, you can paste all the files in it into your file editor, and don't forget to fill in everything you need in the settings section.
After that, you can run the file with node .
in your terminal
env-example
clientId=
clientSecret=
redirectURL=
You can get your clientId and clientSecret on the discord developer portal website, there you must have an application, and if there is no application yet, you need to create one first. if so, you just need to select the application and go to the OAuth2 menu, and select the general page, and do the same as in the screenshot below
for the redirectURL=
you can fill it with https://localhost:3000/login
or with https://yourcoolwebsite.domain/login
authorization
the file below is located in home.ejs
<a href="Your authorization link is here" class="login">Login<span></span><i class="bx bx-rocket"></i></a>
You can get the authorization link from the Discord developer portal website, it is located in the OAuth2 menu, on the URL Generator page do exactly the same as the example below
Once you feel like everything is finished or you don't need anything else, you can try it by pressing the link https://localhost:3000/