<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anton Orlov on Medium]]></title>
        <description><![CDATA[Stories by Anton Orlov on Medium]]></description>
        <link>https://medium.com/@orels1?source=rss-c6a316ebb8d1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*KWGoXyhdAWOXJEhmtKHPwA.png</url>
            <title>Stories by Anton Orlov on Medium</title>
            <link>https://medium.com/@orels1?source=rss-c6a316ebb8d1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 03:37:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@orels1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I switched to Vue.js for personal projects. A React dev perspective]]></title>
            <link>https://medium.com/@orels1/how-i-switched-to-vue-js-for-personal-projects-a-react-dev-perspective-49dcce0173b8?source=rss-c6a316ebb8d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/49dcce0173b8</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Anton Orlov]]></dc:creator>
            <pubDate>Mon, 13 Nov 2017 16:47:01 GMT</pubDate>
            <atom:updated>2017-11-13T19:40:54.986Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XH9l-6x9SUlmGxPlZFaoIA.jpeg" /></figure><p>I’ve been a react dev for quite a while at this point. And for me it all started as a search for a new technology to power my personal projects. Years later — I’m working as a full-time React developer, and I can’t feel better about it.</p><p>That doesn’t mean that I’m not looking around, though. I’m the kind of person, who tries to find a perfect tool for the job, even if it might be not in my skillset (yet). And, obviously, Vue made a lot of buzz lately, so it was hard to pass by.</p><p>But every time I looked at the official docs, they greeted me with something, that looked outdated and felt like a step back compared to what I did atm. I’m not sure if it is a docs’ issue, or mine, but that’s where we’re at. And judging by what I see around me — I’m not alone, hence all the holywars.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sV1iEK90wr8r3B3R_VBRXQ.png" /><figcaption>That’s what you see first on vuejs.org</figcaption></figure><p>Thankfully, a friend of mine showed me, that Vue is not necessarily what you see on it’s front page, it can actually be pretty cool and modern. He linked me <strong>vue-class-component</strong>, and that changed everything.</p><p>For me, as a React dev, that should’ve been advertised right at the front page, maybe even above the logo, or in a popup, or I don’t know… you get the point. That was like a revelation, which made me keep digging. And I ended up with something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*-rq3k1cY0NrnGMCxFFMqOw.png" /><figcaption><em>Fellow React developers might recognise familiar structure</em></figcaption></figure><p>I was shocked, to say the least.</p><blockquote>What I ended up with was a react-like component, with css-modules right out of the box, and even template engines like pug! All working together, without changing (almost) anything in my webpack config and such.</blockquote><p>Don’t get me wrong, changing webpack configs isn’t hard, especially, when you’ve done it a number of times already. But we’re talking about personal projects, where you have limited time, and you want that time to be spent on the actual idea, not the boilerplate.</p><p>And that doesn’t mean that everything is purely magical. I’m not a huge fan of magic myself, BUT! In a sideproject, I can only imagine how much time I could’ve saved if I had such tool at hand.</p><blockquote>And what’s even better — I didn’t have to re-learn all the things! Well, almost. Most of my questions are answered in the docs, and all you have to learn is some syntax things and shortcuts. But if you want to — you can even use JSX, yes, that JSX, the one you use in React every day!</blockquote><p>And the list goes on. At this point I’m rebuilding frontend for a project I’ve worked on a for a while now. And I’m doing it in Vue. Why? Because it’s just faster. It helps me achieve my goals in a record time.</p><p>To be fair, I don’t need anything highly complex in terms of build structure, my app is simple enough that react-create-app or, in this case, vue-cli with cue-loader can handle everything I want. And it just makes my life better.</p><p>I can simply drop some &lt;style lang=&quot;sass&quot; module&gt; and I’m good to go with CSS modules!</p><p>Want to use <strong>pug</strong> inside templates? &lt;template lang=&quot;pug&quot;&gt;does it. The event or prop bindings are pretty simple too. And an out-of-the box support for keyboard events does wonders.</p><blockquote>No need to bring an external dependency, just do a @keyup.shift and it works!</blockquote><p>I know, it’s a bit too magical for a sceptical React dev out there, but, personally, I think that it’s worth it. It wasn’t totally without hitches, that’s why I even included a whole section at the bottom with tips you mind find useful as a React dev trying out Vue.</p><p>And even if you’re not convinced to fully embrace Vue in your personal stuff — you can merge it with React and use them both! Sounds a bit crazy, but you should check that approach too.</p><blockquote>In the end I want to say this. Just try it. I was really sceptical about it, but it turned out great. I won’t be using Vue in large scale production anytime soon (not because it can’t handle it, but because that’s just not what I do), but my personal projects will see a lot of Vue now, that’s for sure.</blockquote><h4><strong>Useful stuff</strong></h4><ul><li><a href="https://vuejs.org/v2/guide/">Official Vue Docs</a></li><li><a href="https://router.vuejs.org/en/">Vue-Router Docs</a></li><li><a href="https://vue-loader.vuejs.org/en/">Vue-Loader Docs</a></li><li><a href="https://vuex.vuejs.org/en/">Vuex Docs</a> (state management, think redux/flux)</li><li><a href="https://alligator.io/vuejs/jsx-render-functions/">JSX in Vue</a> (read a bit about Vue first)</li><li><a href="https://github.com/vuejs/vue-class-component">Vue Class Component</a> (ES6)</li></ul><h4>Things to look out for</h4><ul><li>By default Vue will only use hash as a class name for CSS-Modules, which is ok-ish for production, but really hard for development. You might want to open your vue-loader config (<strong>build/vue-loader.conf.js</strong> by default) and add something like this. It will make your CSS-Modules class names look like Button_chs3f</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6028f8a7f0d9dc3c29e78a50f374c12/href">https://medium.com/media/d6028f8a7f0d9dc3c29e78a50f374c12/href</a></iframe><ul><li>You might want to change router to HTML5 history mode (so it will act similar to react-router . To do so — open your src/router/index.js and add mode: &#39;history&#39;, to the new Router({}) .</li><li>I recommend using Vue template blocks (with something like Pug) for most of the templates, it’s a lot faster and more readable than doing everything in JSX (no offence to JSX).</li><li>This one somehow wasn’t as obvious as I expected. If you want to pass children to component (i.e. have something like &lt;my-component&gt;Child Content&lt;/my-component&gt; ), then it should have at least one &lt;slot /&gt; tag in its template.</li><li>At last — don’t forget that you need to use transform-decorators-legacy babel plugin for vue-class-component decorators to work properly. You’ll also need to define all the components and props you want your new and shiny component to use inside that decorator. It follows the same data structure as the base Vue constructor, so look in the Vue docs for full list of options.</li></ul><blockquote>And with that, you should be good to go! Hopefully this will help you out, and you won’t need three attempts to get this whole thing figured out and to start enjoying Vue, like it was for me.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49dcce0173b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using discord oauth2. A simple guide and an example nodeJS app]]></title>
            <link>https://medium.com/@orels1/using-discord-oauth2-a-simple-guide-and-an-example-nodejs-app-71a9e032770?source=rss-c6a316ebb8d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/71a9e032770</guid>
            <category><![CDATA[discord]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[express]]></category>
            <category><![CDATA[oauth]]></category>
            <dc:creator><![CDATA[Anton Orlov]]></dc:creator>
            <pubDate>Tue, 16 May 2017 22:19:34 GMT</pubDate>
            <atom:updated>2017-05-16T22:40:34.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*64GSosmMFaKyBM5Dn_3aeQ.png" /></figure><p>So it all started with a friend of mine really struggling with building an app with authorization through Discord. And since I remember myself having a lot of trouble understanding oauth flow for a first time, I figured I could help out and write a simple guide for everyone struggling with the same thing.</p><blockquote>This guide is really basic and is aimed at explaining only the core concepts of oauth2 flow.</blockquote><h3>Introduction</h3><h4>First things first. Useful links:</h4><ul><li><a href="https://discordapp.com/developers/docs/topics/oauth2">Discord’s docs on oauth 2</a></li><li><a href="https://tools.ietf.org/html/rfc6749#section-4.1">RFC 6749 spec</a>. I know it’s not fancy, but it’s really the best source of info on the subject</li><li><a href="https://github.com/orels1/discord-token-generator">Source files for this project</a></li></ul><h4>Tools and tech used</h4><p><strong>Editor.</strong> You can use any editor to follow this guide. I, personally, use <a href="https://www.jetbrains.com/webstorm/">WebStorm</a> for big projects and <a href="https://atom.io/">Atom</a> for smaller stuff. But you can use any smart editor you prefer.</p><p><strong>Backend. </strong>An example app will be built with a modern version of JS supported by nodeJS 7.10. It should be easy to understand if you had any kind of nodeJS (and expressjs) experience before, but I will explain some syntax things where needed.</p><p><a href="https://nodejs.org/en/">If you don’t have nodeJS installed, you can grab the 7.10+ version on the official website</a></p><p><strong>Frontend. </strong>The frontend will be built with pure <a href="https://facebook.github.io/react/">ReactJS</a>. The frontend is not a part of this guide, so I won’t explain how to create it here. If you’re not familiar with React and plan on creating anything for the frontend — you should definitely check it out! You can see the code of that in the <a href="https://github.com/orels1/discord-token-generator/">project’s github repo</a>.</p><h4>Ok, enough of that let’s get started!</h4><p>As much as I would like to get to coding, we should, at first, figure out how aouth2 works.</p><p><strong>Basically the process looks like this</strong></p><ul><li>User clicks a link</li><li>User is redirected to Discord where he clicks on an “Authorize” button</li><li>User is redirected back to our service with code in the URL</li><li>Our service makes an authorized request to Discord to exchange code for tokens</li></ul><p>And that’s it! Pretty simple, huh?</p><blockquote><strong>Note</strong>: we won’t really implement token refresh in this example as it involves saving user’s tokens and so on. But it shouldn’t be a problem to do yourself after completing this guide</blockquote><p>Looking at the steps up there we can plan out our app. This is what we’ll need</p><ul><li>A simple root URL that will send our index.html to the user to start the process</li><li>A URL that will redirect user to Discord with some data added to the request</li><li>Another URL called a “redirect” or “callback” URL, to which Discord will redirect our user after clicking “Authorize”</li></ul><p>Let’s get to coding!</p><h3>The guide</h3><h4>Creating a basic server</h4><blockquote>During the coding part I will post the pieces of code first and then explain them</blockquote><p>Fist of all — create a new folder, open a terminal inside it and run</p><pre>npm install express</pre><p>This will, obviously, install expressjs framework, which is one of the many tools used to build APIs with node. I find express one of the simpler ones to use and support over time.</p><p>Now create a server.js file and paste this code in it</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/528cd57758b4daddb9eff870842d2781/href">https://medium.com/media/528cd57758b4daddb9eff870842d2781/href</a></iframe><p>This is a very basic setup, that will run our app on port 50451 and send back index.html when you open the root localhost:50451 URL.</p><h4>Creating an API</h4><p>Now we can start building our simple API. Create an api folder and in it create a discord.js file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/765949df8e7b2a89db7c2dc59a1f2d5a/href">https://medium.com/media/765949df8e7b2a89db7c2dc59a1f2d5a/href</a></iframe><p>So here we’re creating a router object, which basically allows us to attach functions to certain URLs, like we did with app.get() in our server.js the only difference is that router is used as a “middleware”.</p><blockquote>Basically when our server receives a request — express looks through all the available routes and then triggers all the middlewares attached to it, until there is nothing else to trigger. You can read more about express router <a href="http://expressjs.com/en/4x/api.html#router">over here</a>.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f102f0ea834733623312ab52df9be5e9/href">https://medium.com/media/f102f0ea834733623312ab52df9be5e9/href</a></iframe><p>And here we’re getting CLIENT_ID and CLIENT_SECRET from our environmental variables into the app itself. process.env is a global object which can be accessed from anywhere in your node app.</p><p>The redirect variable simply encodes our “callback” URL so we can pass it to discord as a query string.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1501821c4294b7fb9fd07f91d7e7b24b/href">https://medium.com/media/1501821c4294b7fb9fd07f91d7e7b24b/href</a></iframe><p>This is the most important part. Remember that “URL that will redirect user to Discord with some data added to the request”? Well that’s it. Here we’re using the new and fancy JS string templates to add our CLIENT_ID and redirect to the authorization URL.</p><p><strong>A bit about string templates in JS:</strong></p><p>Basically you can insert any variables into the string using a syntax like that</p><pre>`Hi, ${username}`</pre><p>Which is equivalent for</p><pre>&#39;Hi, &#39; + username</pre><p><strong>And back to our app</strong></p><p>Now we have our discord.js module, but it’s not connected to our server. To do that we’ll need to add a reference to it into our server.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37cea8534364069cba88085d747a50a7/href">https://medium.com/media/37cea8534364069cba88085d747a50a7/href</a></iframe><p>Just add the code above after everything else in server.js</p><p>Basically we told express to use the router inside discord.js for any requests that match /api/discord URL.</p><p>Before we can test our app at this state — we need to create an app at Discord, as well as create a basic index.html file.</p><h4>Creating a Discord app</h4><p><a href="https://discordapp.com/developers/applications/me/create">Click here to open app creation page</a>. You should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*HozG_L30vJ5ILKUf7ohkwA.png" /><figcaption>Discord’s app creation form</figcaption></figure><p>Fill in App Name field, and click the <strong>Add Redirect</strong> button. Which is the exact URL to which Discord will send our user after clicking “Authorize”.</p><p>For our example use this URL:</p><pre>http://localhost:50451/api/discord/callback</pre><p>We did not implement it yet, but that’s fine, we’ll do it later.</p><p>Click “Create App” and you should see something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*2cjVXMKYfQJtve2WnJSECQ.png" /></figure><p>Copy the <strong>Client ID</strong> and <strong>Client Secret</strong> somewhere safe for now. We won’t need to open Discord website anymore, so you can close it.</p><blockquote><strong>Important:</strong> Never share your secret anywhere publicly. It’s called secret for a reason!</blockquote><h4>Creating an index.html</h4><p>So we created our basic server, now we need to create a page with a link user can click to authorize with discord.</p><p>Create an index.html file beside your server.js and paste this code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6134afcdd169e579d87bc28c82621374/href">https://medium.com/media/6134afcdd169e579d87bc28c82621374/href</a></iframe><p>If you double click on it — you should see something like this in your browser;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*yKWDE5vx6kyBv2G8rkDyGw.png" /></figure><p>We’re almost ready to launch our server, but we need to set our CLIENT_ID and CLIENT_SECRET environmental variables. If you know how to do that — go for it. If you don’t know, here are the guides and stackoverflow answers for different OS:</p><ul><li><a href="https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps">Linux</a></li><li><a href="https://kb.wisc.edu/cae/page.php?id=24500">Windows</a></li><li><a href="http://stackoverflow.com/questions/7501678/set-environment-variables-on-mac-os-x-lion">Mac</a></li></ul><p>Now we’re ready to launch our server! Just open a terminal in a folder with your server.js and run this command</p><pre>node server.js</pre><p>You should get this message if everything went fine</p><pre>Running on port 50451</pre><p>Now you can open <a href="http://localhost:50451/">localhost:50451</a> in your browser and see the same index.html we created earlier.</p><p>If you’ll click the link — it should get you to the page like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9Jxhy5G_VJX-1fF0eQbXA.png" /></figure><p>If it shows an error instead — that probably means that you didn’t set your evn vars correctly.</p><p>If you click authorize — you’ll get an error:</p><pre>cannot GET /api/discord/callback</pre><p>Since we didn’t implement it yet. So let’s do just that!</p><h4>Creating a callback handler</h4><p>We will need a couple of extra things to create a callback handler. Run this command</p><pre>npm install node-fetch btoa</pre><p>node-fetch is a package that allows us to use a new and fancy fetch API to perform HTTP requests. I like it for it’s simplicity and unified syntax between serverside and the browser.</p><p>btoa allows us to use the browsers’ btoa base64 encoding from browsers in our backend code.</p><p>Now add it to the requirements on top of discord.js like this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4747433265aae4bf137cd875439ee7ae/href">https://medium.com/media/4747433265aae4bf137cd875439ee7ae/href</a></iframe><p>Don’t worry about catchAsync for now, I will explain it later.</p><p>And now, after our /login handler we’ll create our /callback handler. To do that — paste this code into discord.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/78bb18d4f8e421113e75bf431933d7e7/href">https://medium.com/media/78bb18d4f8e421113e75bf431933d7e7/href</a></iframe><p>This is quite a bit of code, let’s see what we’re doing here, line-by line.</p><blockquote><strong>async/await: </strong>I’m a fan of the new async/await syntax in JS, but it requires us to add an extra error catcher on top, so we won’t loose our errors. That is achieved by wrapping our handler inside a catchAsync function, which I will show later in the guide.</blockquote><p><strong>Line 2:</strong> we’re checking that Discord send us the authorization_code by setting a code query string. If not — we’ll throw an error;<br><strong>Line 3:</strong> we extract our code from the URL.<br><strong>Line 4: </strong>we encode our CLIENT_ID and CLIENT_SECRET as a Base64 string (that’s what we needed btoa package for), it’ll be used to authorize our token exchange request.<br><strong>Lines 5–11: </strong>we perform a request to Discord’s token exchange URL adding the code we got and our redirect_uri which is the same as in the /login URL.<br>According to the RFC 6749 this should be a POST request with a Basic HTTP authorization header.<br><strong>Line 12:</strong> we convert the raw response to JSON we can read.<br><strong>Line 13:</strong> we redirect our user to the home page of our app with the token we got set in the URL (to show it on the webpage)</p><blockquote><strong>Note:</strong> In the real app you wouldn’t want to pass such a sensitive info in the URL, but rather set it as a cookie or just return it as a response to your app that will then show it to the user in an async way.</blockquote><h4>Adding a global error catcher</h4><p>Before we finish up here — we need to do a couple more things so our app won’t loose it’s errors.</p><p>Express allows us to add a middleware that will catch all the errors thrown by our app. To do that you’ll need to add a new middleware with app.use() in the very end of your app.</p><p>Open server.js and paste this after everything else:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94730db15004bdb94e1fba912c1ba9ce/href">https://medium.com/media/94730db15004bdb94e1fba912c1ba9ce/href</a></iframe><p>Basically here we use a basic switch syntax to check which error we got and send a message to our client based on that.</p><p>That’s good and all, but when using async/await in JS, if you don’t wrap your function in try{...} catch(e) {...} — your error’s will just disappear, causing your server to throw an “unhandled promise rejection” error and closing the app with a non-zero exit code;</p><p>To fix that we need to create a little wrapper. Make a new file called utils.js right beside your server.js and paste this into it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ecd659eeb6a9df9b1f3f3dda149a42b/href">https://medium.com/media/0ecd659eeb6a9df9b1f3f3dda149a42b/href</a></iframe><p>This is really basic and you all it does is adds a catch to our route handler, which then calls our error catching middleware we just created with next(err)</p><h4>Running the app</h4><p>And now you’re good to go! Just run</p><pre>node server.js</pre><p>Click the link at <a href="http://localhost:50451/">localhost:50451</a>, authorize your app and then you should land on the page with the URL that looks something like this:</p><pre><a href="http://localhost:50451/?token=33JjS8YlJHebOWuP9vo9IMrf1Wy7y8">http://localhost:50451/?token=33JjS8512HebOWuP9vo9IMrf1Wy7y8</a></pre><blockquote>Note: If something goes wrong — you should see an error name in your terminal. With that you can find an explanation <a href="https://tools.ietf.org/html/rfc6749#section-5.2">on the RFC 6749 website</a>.</blockquote><p>As you might’ve guessed — that is your access token! Which you can use to authorize a request to http://discordapp.com/api/users/@me that will return username of the authorized user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*UUhxiwymzcwwxhRX43dt0w.png" /><figcaption>I used Postman to make a request to Discord API</figcaption></figure><blockquote><strong>Tip: </strong>To make an authorized request with the token you just recieved — you need to add an “Authorization” header to your request that looks like this: Bearer &lt;your_token_here&gt;</blockquote><h3>What’s next?</h3><h4>Token refresh</h4><p>There are a lot of things to add here. First of all — tokens rotation. The basic algorithm for that should look like this:</p><ul><li>Save access_token and refresh_token somewhere, like a DB, or just a JSON file.</li><li>Check the response code for your authorized Discord API requests.</li><li>If the code is 401 — make a new request to the same /token endpoint as in our /callback but with our refresh_token instead of code</li><li>Save the new access_token and refresh_token and use them with your requests.</li></ul><blockquote><strong>Note:</strong> Discord’s tokens last 7 days</blockquote><h4>Some API requests</h4><p>You didn’t get your token for nothing, right? You wanted to make some Discord API requests!</p><p><a href="https://discordapp.com/developers/docs/topics/oauth2">Got to Discord’s dev documentation to see what you can do with it!</a></p><h4>UI</h4><p>We also want our users to looks at something beautiful while using our app.</p><p>You can find a simple React UI with use of CSS-Modules and a basic BEM-methodology in the project’s github repo. <a href="https://github.com/orels1/discord-token-generator/tree/master/src/js">Check it out!</a></p><h3>Conclusion</h3><p>That was a pretty lengthy tutorial, but, as I said, I remember myself banging my head against the wall trying to understand oauth2. So I tried to explain all the things necessary to get the basic concepts.</p><blockquote>I’m sure you could be more efficient with the example app we’ve built today. But I think it gets the job done in terms of showing how everything works.</blockquote><p>If you have any questions — hit me up in the comments section or on <a href="https://twitter.com/orels1tips">twitter</a>. And don’t forget to check the <a href="https://github.com/orels1/discord-token-generator">sources of the app on github</a>. They have a lot nicer UI than what we’ve got here ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*32Zf8s3rPOo4Cbciclq0_Q.png" /><figcaption>A simple React UI made for this project</figcaption></figure><p>Anyways, thanks for reading, and I wish you a good luck with your own apps utilizing Discord’s oauth2!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71a9e032770" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>