<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: aben</title>
    <description>The latest articles on DEV Community by aben (@bacloud22).</description>
    <link>https://dev.to/bacloud22</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F795403%2Fb40f0c1a-211d-49c7-9613-2df99bb28753.jpg</url>
      <title>DEV Community: aben</title>
      <link>https://dev.to/bacloud22</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bacloud22"/>
    <language>en</language>
    <item>
      <title>How do you verify an email for sign-up ?</title>
      <dc:creator>aben</dc:creator>
      <pubDate>Thu, 28 Jul 2022 13:33:00 +0000</pubDate>
      <link>https://dev.to/bacloud22/how-do-you-verify-an-email-for-sign-up--34k3</link>
      <guid>https://dev.to/bacloud22/how-do-you-verify-an-email-for-sign-up--34k3</guid>
      <description>&lt;p&gt;Hi folks, &lt;br&gt;
I hope you are doing well !&lt;/p&gt;

&lt;p&gt;Please let me know what do you think about this ?! because I already implemented a basic verification mechanism.&lt;/p&gt;

&lt;p&gt;So this was my response to someone asking for the same question:&lt;/p&gt;

&lt;p&gt;I came across a Reddit post where one explained that one click on the link is not sufficient and might lead to errors and a failure of the verification. The logic is simple and legit, when the email containing the link is received, there might be link scanners (bots) on the SMTP server (Outlook, Gmail etc). Just like when you past a link on major social platforms, there is always a bot that hits the link. I did not try it myself but I believe Outlook scans some links (when you copy past a link it is converted to a thumbnail with page's content). So this process oblige you to do a verification by two steps, and I personally think of these two methods:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Maybe when the user clicks, he needs to past his own password used for sign-up (looks fine). &lt;/li&gt;
&lt;li&gt;Or provide a one time password with the email so that the user along with the verification link (maybe split then re-concat) the same token you send for verification and ask the user to enter that second part (this seems easier).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thanks !&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>security</category>
      <category>authentication</category>
    </item>
    <item>
      <title>Authentication strategy todos</title>
      <dc:creator>aben</dc:creator>
      <pubDate>Sun, 29 May 2022 20:12:28 +0000</pubDate>
      <link>https://dev.to/bacloud22/authentication-strategy-todos-4jl1</link>
      <guid>https://dev.to/bacloud22/authentication-strategy-todos-4jl1</guid>
      <description>&lt;p&gt;Hi friends, &lt;br&gt;
I try to remember myself what is the normal and secure flow of an authenticated vs unauthenticated user. I've been using the web for eternity but I would like to be sure and maybe you guide me through this.&lt;/p&gt;

&lt;p&gt;What are authentication rules ? &lt;/p&gt;

&lt;p&gt;For instance, an authenticated user cannot sign-in until he/she sign-out. He cannot sign in while being signed in already. What about redirections after these actions... etcetera. &lt;/p&gt;

&lt;p&gt;Is there any web resource to follow on this ? &lt;/p&gt;

&lt;p&gt;Of course I'm using no library and implementing it myself via JWT. &lt;/p&gt;

&lt;p&gt;All I need is a list to follow. &lt;/p&gt;

&lt;p&gt;Thanks a lot 😀&lt;/p&gt;

</description>
      <category>help</category>
      <category>webdev</category>
    </item>
    <item>
      <title>await, then, return?</title>
      <dc:creator>aben</dc:creator>
      <pubDate>Sat, 21 May 2022 06:21:04 +0000</pubDate>
      <link>https://dev.to/bacloud22/await-then-return-51gf</link>
      <guid>https://dev.to/bacloud22/await-then-return-51gf</guid>
      <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I'm using &lt;strong&gt;Sharp&lt;/strong&gt; for compressing uploaded user images. I want to be sure that my approach is safe and performs in theory for all cases.&lt;/p&gt;

&lt;p&gt;I'm rather hesitant, as I didn't set proper testing yet and for now I didn't deploy the app but doing big refactoring on the code then I will test everything the next days.&lt;/p&gt;

&lt;p&gt;I am hesitant if my code is correct, and would like to hear from you also about it. Here it is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;width_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;thumbnailBuffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;sharp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalBuffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sharp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalBuffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;toBuffer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sharp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalBuffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;width_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;inside&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;toBuffer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`post/listings#postListingHandler#sharp: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Will &lt;code&gt;thumbnailBuffer&lt;/code&gt; contain a value of a new buffer or a promise or this whole thing is incorrect ?&lt;/p&gt;

&lt;p&gt;Thanks a lot !!&lt;/p&gt;

</description>
      <category>help</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Looking for a devOps to assist setting a web service</title>
      <dc:creator>aben</dc:creator>
      <pubDate>Tue, 10 May 2022 11:13:14 +0000</pubDate>
      <link>https://dev.to/bacloud22/looking-for-a-devops-to-assist-setting-a-web-service-1nc2</link>
      <guid>https://dev.to/bacloud22/looking-for-a-devops-to-assist-setting-a-web-service-1nc2</guid>
      <description>&lt;p&gt;Hi,&lt;br&gt;
I'm looking for a devOps with an experience in Linux systems. I will be deploying a NodeJS web-app on AWS EC2.&lt;/p&gt;

&lt;p&gt;Stack specification:&lt;br&gt;
MERN: NodeJS, MongoDB and Redis&lt;br&gt;
Jenkins or other CI tool (non Java based preferably)&lt;br&gt;
Other dependencies: pm2, node-gyp, webpack.&lt;/p&gt;

&lt;p&gt;I'm looking for collaboration so I'm asking for a free assistance.&lt;br&gt;
The project is not monetized and there is no business behind &lt;strong&gt;yet!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I will be working so much on it fixing bugs in the web-app itself before going prod. But I would like to see a dev version online...&lt;/p&gt;

&lt;p&gt;If it works out well and then you want to be a collaborator, this is very feasible, we could arrange that.&lt;/p&gt;

&lt;p&gt;It is a web-app of a year of work, it is BIG ! and sadly I have no business nor money &lt;em&gt;yet&lt;/em&gt; to pay for it..&lt;/p&gt;

&lt;p&gt;Thanks :)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>visitor-counter: tracking the amount of visitors on your website</title>
      <dc:creator>aben</dc:creator>
      <pubDate>Thu, 07 Apr 2022 06:51:00 +0000</pubDate>
      <link>https://dev.to/bacloud22/visitor-counter-tracking-the-amount-of-visitors-on-your-website-1260</link>
      <guid>https://dev.to/bacloud22/visitor-counter-tracking-the-amount-of-visitors-on-your-website-1260</guid>
      <description>&lt;p&gt;Hello friends,&lt;br&gt;
I'm happy to be back !&lt;/p&gt;

&lt;p&gt;Disclaimer: I'm not the author of &lt;a href="https://github.com/erikthalen/visitor-counter"&gt;visitor-counter&lt;/a&gt; but I think it needs some attention.&lt;/p&gt;

&lt;p&gt;I started using &lt;code&gt;visitor-counter&lt;/code&gt; as a Fastify plug-in with minor tweaks as it is intended to integrate Express apps. Nevertheless, I think it's an amazing plug-in to talk about, as some nice repos might go and age unseen.&lt;/p&gt;

&lt;p&gt;I talked with author about supporting other web (API/routing) libraries like Fastify, Koa, Nest ... So this post is to have a little kick back to the author. You may give him a star, and better if you could test it and advance support of other libraries.&lt;/p&gt;

&lt;p&gt;Demo: &lt;a href="https://counter.xxxxxxxxxx.xyz/"&gt;https://counter.xxxxxxxxxx.xyz/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reason why I'm liking it very much, is because I was looking for a visitors analytics solution; Well, I couldn't find any solution to integrate to my web-app, all other solutions are big tech, docker based, with so much constraints (separate service, so CORS, certificates, DB... ).&lt;/p&gt;

&lt;p&gt;This is it for &lt;code&gt;visitor-counter&lt;/code&gt;, I hope you like it, give him a star if you do :)&lt;/p&gt;

&lt;p&gt;Have a nice day! &lt;/p&gt;

</description>
      <category>express</category>
      <category>javascript</category>
      <category>node</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Any performant solution to link to a thumbnail instead of an image</title>
      <dc:creator>aben</dc:creator>
      <pubDate>Thu, 31 Mar 2022 09:19:46 +0000</pubDate>
      <link>https://dev.to/bacloud22/any-performant-solution-to-link-to-a-thumbnail-instead-of-an-image-3516</link>
      <guid>https://dev.to/bacloud22/any-performant-solution-to-link-to-a-thumbnail-instead-of-an-image-3516</guid>
      <description>&lt;p&gt;Hello friends,&lt;/p&gt;

&lt;p&gt;I'm happy to be back and I hope you are doing well!&lt;/p&gt;

&lt;p&gt;I have a question today. Is there in the web of today, a technology, library, API, standard or any solution to be able to have a thumbnail from an image living publicly on the internet on the fly ?&lt;/p&gt;

&lt;p&gt;The reason is obvious, caring about UX so that in users browsers they have a thumbnail instead of the big picture (on the fly hopeful).&lt;/p&gt;

&lt;p&gt;I think of a serverless function on AWS or other provider, to do the compression and resize on the fly ? what do you think ? any other &lt;br&gt;
easier solution ?&lt;/p&gt;

&lt;p&gt;Take care!&lt;/p&gt;

</description>
      <category>help</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
