<?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: Zeeshan Ahmad</title>
    <description>The latest articles on DEV Community by Zeeshan Ahmad (@zeeshanahmad9).</description>
    <link>https://dev.to/zeeshanahmad9</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%2F3457331%2F1a9b02fb-8f4b-4341-9803-9b795139f03f.jpg</url>
      <title>DEV Community: Zeeshan Ahmad</title>
      <link>https://dev.to/zeeshanahmad9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zeeshanahmad9"/>
    <language>en</language>
    <item>
      <title>Access Token and Refresh Token</title>
      <dc:creator>Zeeshan Ahmad</dc:creator>
      <pubDate>Mon, 06 Oct 2025 13:56:11 +0000</pubDate>
      <link>https://dev.to/zeeshanahmad9/access-token-and-refresh-token-2i2h</link>
      <guid>https://dev.to/zeeshanahmad9/access-token-and-refresh-token-2i2h</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7raq0xqga3h0v96n5uq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7raq0xqga3h0v96n5uq.png" alt=" " width="780" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Access Token
&lt;/h2&gt;

&lt;p&gt;Access tokens are &lt;strong&gt;short-lived&lt;/strong&gt;, that allow the user to access resources without needing to log-in repeatedly. These are sent with an each API request (Authorization: Bearer ). If they are stolen, attacker would have a very shorter time window. Their life span vary company to company but in general their life span is 30-90 mints.&lt;/p&gt;

&lt;p&gt;Access tokens are very useful when you want a &lt;strong&gt;password less&lt;/strong&gt; login. Similarly, they are useful when you want to access the shared resources. For example, when you want to edit or use the file owned by someone else, access tokens make it easier and secure for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refresh Token
&lt;/h2&gt;

&lt;p&gt;Refresh tokens are &lt;strong&gt;long lived&lt;/strong&gt;, that are used to generate the access tokens without asking the user to login with your credentials frequently. They are stored securely on the authorization server and sometimes stored in httpOnly secure cookies. It is because they must be stored securely in order to avoid its vulnerability to attackers. Their life span also vary company to company but in industry practice it has the life span of 30-90 days.&lt;/p&gt;

&lt;p&gt;When an access token expires, refresh token is used to get a new one without logging in. Because user is authenticated on the basis of refresh token.&lt;/p&gt;

&lt;p&gt;Every time a refresh token is used to generate the access token, the old refresh token becomes invalid and it is also regenerated in order to avoid security threats. This technique is called as &lt;strong&gt;Rotation&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  JWT
&lt;/h2&gt;

&lt;p&gt;JWT (JSON Web Token) is popular token format because it is stateless , compact (self-contained claims) and easy to transport in HTTP headers. A JWT can be a access token and a refresh token as well. But refresh token less use JWT format.&lt;/p&gt;

&lt;p&gt;JWT generates a signature by hashing header + payload with your secret key. Let’s take an example to understand it easily.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const payload = {
    id: "user123",
    name: "John",
    email: "john@123.com"
}

const SECRET_KEY = "your_secret_key"

jwt.sign(payload, SECRET_KEY, {expiresIn: "10m"})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some beginners think &lt;code&gt;jwt.sign()&lt;/code&gt;, &lt;strong&gt;encrypts&lt;/strong&gt; the &lt;em&gt;payload&lt;/em&gt;, it does not. It just &lt;strong&gt;signs&lt;/strong&gt;, which means if anyone try to tamper it, the signature verification fails. So it just make your &lt;em&gt;payload&lt;/em&gt; tamper-proof. For instance, after signing the token looks like this :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJzdWIiOiJ1c2VyMTIzIiwibmFtZSI6IkFsaWNlIiwicm9sZSI6InByZW1pdW0ifQ.
wL3Jhpc6pCkJkT7Yt3cvvjTgC1z0sX4eS9B3Gx6w3Nk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to verify it, we use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const decoded = jwt.verify(token, SECRET_KEY) //token: token sent by user
console.log("Token Data: ", decoded)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our &lt;strong&gt;claims&lt;/strong&gt; (payload + header) are decoded with this verification that they were not altered. Now understand the terms &lt;strong&gt;stateless&lt;/strong&gt; and &lt;strong&gt;self-contained&lt;/strong&gt; used earlier. Later means a JWT includes all the claims (payload + header) to identify the user nothing is required from the database that is enough to authenticate the user. Stateless means server does not need to store the session data in the database. Instead the all the claims are present in the token itself. They do not need to make the DB query to look who you are, serve just verify the signature.&lt;/p&gt;

&lt;p&gt;Access token and refresh token aren’t separate, they work together to make the login process smoother and secure. Access tokens are used for initial access while refresh tokens are used to extend that access to the resources over time.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Switching from Simple CSS to Tailwind CSS</title>
      <dc:creator>Zeeshan Ahmad</dc:creator>
      <pubDate>Mon, 25 Aug 2025 07:42:20 +0000</pubDate>
      <link>https://dev.to/zeeshanahmad9/switching-from-simple-css-to-tailwind-css-14ho</link>
      <guid>https://dev.to/zeeshanahmad9/switching-from-simple-css-to-tailwind-css-14ho</guid>
      <description>&lt;p&gt;As developers, we all know how painful writing CSS can be. Too many selectors, too many lines of code, sometimes just for styling a single element. I felt the same.&lt;/p&gt;

&lt;p&gt;That’s when I moved to &lt;strong&gt;Tailwind CSS&lt;/strong&gt;. &lt;strong&gt;Tailwind CSS&lt;/strong&gt; is a utility-first CSS framework. It makes building modern and responsive websites much easier using small, reusable CSS classes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Switched
&lt;/h2&gt;

&lt;p&gt;I was already working in React with CSS3. But when the components started getting bigger and more complex, CSS quickly became messy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple CSS files for different components.&lt;/li&gt;
&lt;li&gt;Searching for selectors in HTML/JSX.&lt;/li&gt;
&lt;li&gt;Writing the same CSS lines again and again.&lt;/li&gt;
&lt;li&gt;Even with simple HTML, styling with CSS was boring and repetitive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then I discovered Tailwind CSS. Instead of writing CSS for everything, you just add pre-defined classes to your element. Tailwind takes care of the CSS for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example: Styling a Button
&lt;/h2&gt;

&lt;p&gt;With CSS3&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button class="btn"&amp;gt;Click&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
.btn {
  background-color: blue;
  color: white;
  padding: 4px;
  border-radius: 100px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With Tailwind CSS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button class="bg-blue-500 text-white p-2 rounded-full"&amp;gt;
  Click
&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look how much simpler that is.&lt;/p&gt;

&lt;h2&gt;
  
  
  But Do You Need to Remember All These Classes?
&lt;/h2&gt;

&lt;p&gt;No! That was my first worry too.&lt;/p&gt;

&lt;p&gt;Tailwind’s documentation is amazing. You just need to check the documentation whenever you need to find a new or unfamiliar class. For example, if you search &lt;strong&gt;border-radius&lt;/strong&gt;, it will show you &lt;strong&gt;rounded&lt;/strong&gt; classes. The docs relate everything back to CSS3, so you don’t feel lost.&lt;/p&gt;

&lt;p&gt;And honestly, after using a class once or twice, you’ll remember it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Responsive Design Made Easy
&lt;/h2&gt;

&lt;p&gt;One of the biggest benefits of Tailwind is responsiveness.&lt;/p&gt;

&lt;p&gt;If you’ve ever added responsiveness using CSS3 media queries, you know how tiring it can be. But Tailwind makes it super simple.&lt;/p&gt;

&lt;p&gt;With CSS3&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;h1 class="heading"&amp;gt;Responsive Heading&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.heading {
  font-size: 1.25rem; 
}

@media (min-width: 768px) {
  .heading {
    font-size: 1.875rem; 
  }
}

@media (min-width: 1024px) {
  .heading {
    font-size: 2.25rem; 
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With Tailwind CSS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 class="text-xl sm:text-2xl md:text-3xl lg:text-4xl"&amp;gt;
  Responsive Heading
&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it, One line. The heading grows smaller on tablet and bigger on desktop automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Switching from simple CSS to Tailwind CSS has made my life as a developer much easier. It saves time, keeps code cleaner, and makes adding responsiveness a breeze.&lt;/p&gt;

&lt;p&gt;If you’re tired of writing the same CSS again and again, give Tailwind a try. Once you use it, you may never want to go back.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>css</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
