<?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: Asad Bukhari</title>
    <description>The latest articles on DEV Community by Asad Bukhari (@asadbukhari).</description>
    <link>https://dev.to/asadbukhari</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%2F781526%2Fd632826d-5862-4f82-b6cc-ec6d22910f89.jpg</url>
      <title>DEV Community: Asad Bukhari</title>
      <link>https://dev.to/asadbukhari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asadbukhari"/>
    <language>en</language>
    <item>
      <title>The Hidden Payment Token Revolution</title>
      <dc:creator>Asad Bukhari</dc:creator>
      <pubDate>Sat, 29 Nov 2025 19:14:00 +0000</pubDate>
      <link>https://dev.to/asadbukhari/the-hidden-payment-token-revolution-4cfl</link>
      <guid>https://dev.to/asadbukhari/the-hidden-payment-token-revolution-4cfl</guid>
      <description>&lt;h2&gt;
  
  
  The Hidden Payment Token Revolution
&lt;/h2&gt;

&lt;p&gt;If you follow the payments space, you’ve probably heard a lot about &lt;em&gt;crypto tokens&lt;/em&gt;, &lt;em&gt;blockchain&lt;/em&gt;, and the “future of money.”&lt;/p&gt;

&lt;p&gt;But the biggest token revolution isn’t happening in crypto.&lt;/p&gt;

&lt;p&gt;It’s happening inside the payment networks we use every single day, Visa, Mastercard, and American Express.&lt;/p&gt;

&lt;p&gt;And the surprising part?&lt;/p&gt;

&lt;p&gt;Most people have &lt;strong&gt;no idea&lt;/strong&gt; it’s happening.&lt;/p&gt;

&lt;p&gt;In this article, I’ll explain what is changing, why it matters, and how this invisible shift is quietly transforming digital payments around the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  We Still Think of Cards the Old Way
&lt;/h2&gt;

&lt;p&gt;For decades, card networks were seen as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A piece of plastic
&lt;/li&gt;
&lt;li&gt;A 16-digit number
&lt;/li&gt;
&lt;li&gt;Something you swipe or enter online
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But that era is fading quickly.&lt;/p&gt;

&lt;p&gt;Today, these companies are less “card brands” and more &lt;strong&gt;global money-movement networks&lt;/strong&gt;, powering apps, digital wallets, recurring payments, and online checkout experiences.&lt;/p&gt;

&lt;p&gt;At the center of this change is something called &lt;strong&gt;network tokenization&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem With the Old System
&lt;/h2&gt;

&lt;p&gt;Every online payment used to rely on your &lt;strong&gt;PAN&lt;/strong&gt;, the Primary Account Number (your 16 digits).&lt;/p&gt;

&lt;p&gt;It worked for many years, but it came with big problems:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. If your PAN leaked, it could be used anywhere
&lt;/h3&gt;

&lt;p&gt;Stolen card numbers could be used across the world.&lt;br&gt;&lt;br&gt;
Fraud became easy.&lt;br&gt;&lt;br&gt;
Everyone lost.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. New cards broke subscriptions
&lt;/h3&gt;

&lt;p&gt;Your card expired,&lt;br&gt;&lt;br&gt;
Your Netflix, Spotify, SaaS apps, hosting, and deliveries all stopped working.&lt;/p&gt;

&lt;p&gt;Merchants lost money.&lt;br&gt;&lt;br&gt;
Customers got annoyed.&lt;br&gt;&lt;br&gt;
Banks got more support calls.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Online payments failed more often
&lt;/h3&gt;

&lt;p&gt;Because PANs are static, banks treat them with more caution.&lt;br&gt;&lt;br&gt;
That means more declines and more failed checkouts.&lt;/p&gt;

&lt;p&gt;The system needed a major upgrade.&lt;/p&gt;

&lt;h2&gt;
  
  
  Network Tokenization Changes Everything
&lt;/h2&gt;

&lt;p&gt;Instead of exposing your real card number, payment networks now replace it with a &lt;strong&gt;token&lt;/strong&gt;, a secure and dynamic code.&lt;/p&gt;

&lt;p&gt;This token is tied to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A specific device
&lt;/li&gt;
&lt;li&gt;A specific merchant
&lt;/li&gt;
&lt;li&gt;A specific purpose
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So even if it is stolen, it is &lt;strong&gt;useless outside its original environment&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  It flips the whole security model:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Stolen PAN, dangerous
&lt;/li&gt;
&lt;li&gt;Stolen token, harmless
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple and powerful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Tokens Feel Like Magic
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✓ A stolen token is worthless
&lt;/h3&gt;

&lt;p&gt;It cannot be used anywhere except where it was created.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✓ Tokens update when your card changes
&lt;/h3&gt;

&lt;p&gt;New card?&lt;br&gt;&lt;br&gt;
New expiry date?&lt;br&gt;&lt;br&gt;
Replacement due to fraud?&lt;/p&gt;

&lt;p&gt;Your tokens update automatically in the background.&lt;/p&gt;

&lt;p&gt;Your subscriptions never break again.&lt;/p&gt;

&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%2F6qdnowt2i4jncvvjnyoc.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%2F6qdnowt2i4jncvvjnyoc.png" alt="Your subscriptions never break again with tokens" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ✓ Higher approval rates
&lt;/h3&gt;

&lt;p&gt;Banks trust tokenized payments more.&lt;/p&gt;

&lt;p&gt;This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fewer declines
&lt;/li&gt;
&lt;li&gt;Faster payments
&lt;/li&gt;
&lt;li&gt;Higher revenue for merchants
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tokenization isn’t just a “feature,”&lt;br&gt;&lt;br&gt;
It is a &lt;strong&gt;major upgrade&lt;/strong&gt; to how online payments work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Scale Is Massive and Growing
&lt;/h2&gt;

&lt;p&gt;This change is not small. It is happening at a global level.&lt;/p&gt;

&lt;h3&gt;
  
  
  Visa
&lt;/h3&gt;

&lt;p&gt;Visa now processes &lt;strong&gt;more tokenized payments than normal PAN payments&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A huge milestone.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mastercard
&lt;/h3&gt;

&lt;p&gt;Mastercard has &lt;strong&gt;billions of active tokens&lt;/strong&gt; and is adding them to almost every online checkout, wallet, app, and subscription service.&lt;/p&gt;

&lt;h3&gt;
  
  
  American Express
&lt;/h3&gt;

&lt;p&gt;American Express is adding tokenization to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wallets
&lt;/li&gt;
&lt;li&gt;Subscriptions
&lt;/li&gt;
&lt;li&gt;Stored cards
&lt;/li&gt;
&lt;li&gt;In-app payments
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All three major networks are moving toward the same future,&lt;br&gt;&lt;br&gt;
a world where the real PAN is rarely used.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Bigger Shift Than the Chip, But Invisible
&lt;/h2&gt;

&lt;p&gt;The last big upgrade in payments was the move from magnetic stripes to chip cards.&lt;/p&gt;

&lt;p&gt;It required:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New machines
&lt;/li&gt;
&lt;li&gt;New cards
&lt;/li&gt;
&lt;li&gt;Training
&lt;/li&gt;
&lt;li&gt;Consumer education
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Network tokenization is different.&lt;/p&gt;

&lt;p&gt;It needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No hardware
&lt;/li&gt;
&lt;li&gt;No training
&lt;/li&gt;
&lt;li&gt;No new behavior
&lt;/li&gt;
&lt;li&gt;No friction for users
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But it brings huge improvements in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security
&lt;/li&gt;
&lt;li&gt;Payment success rates
&lt;/li&gt;
&lt;li&gt;Reliability
&lt;/li&gt;
&lt;li&gt;User experience
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is a quiet revolution that most people never notice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meanwhile, The World Still Debates Crypto
&lt;/h2&gt;

&lt;p&gt;While the world argues about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DeFi
&lt;/li&gt;
&lt;li&gt;Blockchain
&lt;/li&gt;
&lt;li&gt;Digital currencies
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…the &lt;em&gt;real&lt;/em&gt; token revolution is happening inside the payment rails that move billions of dollars every day.&lt;/p&gt;

&lt;p&gt;No hype.&lt;br&gt;&lt;br&gt;
No drama.&lt;br&gt;&lt;br&gt;
Just real impact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Are PANs Becoming Obsolete?
&lt;/h2&gt;

&lt;p&gt;The 16-digit card number will not disappear overnight,&lt;br&gt;&lt;br&gt;
But its role is getting smaller quickly.&lt;/p&gt;

&lt;p&gt;Soon, the PAN will feel like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an old system
&lt;/li&gt;
&lt;li&gt;a legacy ID
&lt;/li&gt;
&lt;li&gt;something used only in special cases
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tokens will power the future of payments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;safer
&lt;/li&gt;
&lt;li&gt;dynamic
&lt;/li&gt;
&lt;li&gt;auto-updating
&lt;/li&gt;
&lt;li&gt;merchant-specific
&lt;/li&gt;
&lt;li&gt;device-bound
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The future is tokenized, and it is already here.&lt;/p&gt;

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

&lt;p&gt;We often look at crypto, new fintech startups, and new technologies to understand what’s coming next.&lt;/p&gt;

&lt;p&gt;But sometimes, the biggest innovations come from the systems improving quietly behind the scenes.&lt;/p&gt;

&lt;p&gt;Network tokenization is one of these upgrades.&lt;/p&gt;

&lt;p&gt;It’s invisible,&lt;br&gt;&lt;br&gt;
It’s global,&lt;br&gt;&lt;br&gt;
It’s already improving billions of payments,&lt;br&gt;&lt;br&gt;
and it will shape the next decade of digital commerce.&lt;/p&gt;

&lt;p&gt;The world may still talk about crypto tokens,&lt;br&gt;&lt;br&gt;
But the real revolution is happening inside Visa, Mastercard, and American Express.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>security</category>
      <category>news</category>
      <category>fintech</category>
    </item>
    <item>
      <title>How to fix CORS errors in Node.js</title>
      <dc:creator>Asad Bukhari</dc:creator>
      <pubDate>Fri, 23 May 2025 19:21:59 +0000</pubDate>
      <link>https://dev.to/asadbukhari/8-common-cors-errors-in-web-development-and-how-to-fix-them-in-nodejs-2pca</link>
      <guid>https://dev.to/asadbukhari/8-common-cors-errors-in-web-development-and-how-to-fix-them-in-nodejs-2pca</guid>
      <description>&lt;h1&gt;
  
  
  8 Common CORS Errors in Web Development (and How to Fix Them in Node.js)
&lt;/h1&gt;

&lt;p&gt;Cross-Origin Resource Sharing (CORS) errors are among the most frequent and frustrating issues in modern web development. These errors stem from strict browser security policies that restrict how resources on a web page can be requested from another domain. While this security mechanism is essential for protecting users from malicious attacks, it often complicates communication between client-side applications and backend APIs. This expanded guide explores the eight most common CORS error types, their root causes, real-world problems that developers face, and best-practice solutions, especially in Node.js/Express environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Missing Access-Control-Allow-Origin Header
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-World Problem
&lt;/h3&gt;

&lt;p&gt;A startup deploying its frontend on Vercel and backend on Heroku finds that all API calls fail with CORS errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cause
&lt;/h3&gt;

&lt;p&gt;This occurs when the server doesn’t include the &lt;code&gt;Access-Control-Allow-Origin&lt;/code&gt; header in its responses, causing the browser to block the request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;cors&lt;/code&gt; package in Express or manually set the headers.&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="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://client-app.com&lt;/span&gt;&lt;span class="dl"&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;h2&gt;
  
  
  2. Preflight Request Failure (OPTIONS Method)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-World Problem
&lt;/h3&gt;

&lt;p&gt;A SaaS platform integrates file uploads, triggering PUT requests with custom headers. These fail silently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cause
&lt;/h3&gt;

&lt;p&gt;Browsers issue an OPTIONS request (preflight) for non-simple HTTP requests. If the server doesn’t handle it properly, the browser blocks the actual request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Explicitly handle the OPTIONS method in Express.&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="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;options&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/upload&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Multiple Origin Values in Header
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-World Problem
&lt;/h3&gt;

&lt;p&gt;An app uses both Nginx and Node.js CORS middleware. Users report inconsistent access issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cause
&lt;/h3&gt;

&lt;p&gt;Multiple layers may inject duplicate CORS headers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Ensure CORS headers are set only once.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; http://api.example.com/data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Credentialed Requests with Wildcard Origin
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-World Problem
&lt;/h3&gt;

&lt;p&gt;A dashboard app using cookies with &lt;code&gt;withCredentials: true&lt;/code&gt; fails due to wildcard origin configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cause
&lt;/h3&gt;

&lt;p&gt;Wildcard &lt;code&gt;*&lt;/code&gt; is not allowed with credentialed requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Specify exact origins and allow credentials.&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="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;whitelist&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Origin/Protocol Mismatch
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-World Problem
&lt;/h3&gt;

&lt;p&gt;Frontend hosted on &lt;code&gt;https://&lt;/code&gt; but backend runs on &lt;code&gt;http://localhost&lt;/code&gt;, causing a mismatch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cause
&lt;/h3&gt;

&lt;p&gt;Exact match including protocol, domain, and port is required.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Add all variants to your origin list:&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;allowedOrigins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://client-app.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Invalid SSL/TLS Configuration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-World Problem
&lt;/h3&gt;

&lt;p&gt;API hosted on a subdomain with a self-signed certificate fails all requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cause
&lt;/h3&gt;

&lt;p&gt;Browsers reject responses from endpoints with invalid or untrusted SSL certificates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Use trusted CA certificates and ensure the HTTPS setup is correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Disallowed HTTP Methods
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-World Problem
&lt;/h3&gt;

&lt;p&gt;Requests using PATCH or DELETE get blocked by the browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cause
&lt;/h3&gt;

&lt;p&gt;The server must explicitly allow these methods in &lt;code&gt;Access-Control-Allow-Methods&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Configure allowed methods correctly:&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="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;PATCH&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DELETE&lt;/span&gt;&lt;span class="dl"&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;h2&gt;
  
  
  8. Unauthorized Request Headers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-World Problem
&lt;/h3&gt;

&lt;p&gt;An app sends custom headers like &lt;code&gt;X-Token&lt;/code&gt; and &lt;code&gt;X-Client&lt;/code&gt;, which are blocked.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cause
&lt;/h3&gt;

&lt;p&gt;Only listed headers are allowed in cross-origin requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Add them to &lt;code&gt;Access-Control-Allow-Headers&lt;/code&gt;.&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="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;allowedHeaders&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;X-Token&lt;/span&gt;&lt;span class="dl"&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;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;CORS can be complex, but understanding how the browser enforces it and how to configure the server correctly helps prevent disruptions in development and production. By following the solutions outlined here and testing configurations thoroughly, developers can build secure and seamless integrations between frontend and backend services.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>security</category>
    </item>
    <item>
      <title>Build Fast, Build Smart: How I Use APIs to Launch MVPs in Days — Not Weeks</title>
      <dc:creator>Asad Bukhari</dc:creator>
      <pubDate>Tue, 13 May 2025 09:17:46 +0000</pubDate>
      <link>https://dev.to/asadbukhari/build-fast-build-smart-how-i-use-apis-to-launch-mvps-in-days-not-weeks-37jh</link>
      <guid>https://dev.to/asadbukhari/build-fast-build-smart-how-i-use-apis-to-launch-mvps-in-days-not-weeks-37jh</guid>
      <description>&lt;h2&gt;
  
  
  Build Fast, Build Smart: How I Use APIs to Launch MVPs in Days — Not Weeks
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Speed doesn’t mean rushing — it means removing friction."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the world of startups, speed is survival.&lt;br&gt;&lt;br&gt;
But here's the reality most founders overlook:&lt;/p&gt;

&lt;p&gt;🚨 &lt;strong&gt;You don’t need to build everything from scratch.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're trying to validate an idea or get user feedback early, investing weeks into building custom payments, login systems, or analytics dashboards is a trap.&lt;/p&gt;

&lt;p&gt;As a developer who helps founders ship fast and ship smart, here's my go-to playbook: &lt;strong&gt;API-first MVP development.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Why Most MVPs Fail (or Burn Out Early)
&lt;/h2&gt;

&lt;p&gt;I’ve worked with startups and solo founders who made the same mistake over and over:&lt;/p&gt;

&lt;p&gt;They treat the MVP like a final product.&lt;/p&gt;

&lt;p&gt;They spend time and budget:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writing custom authentication logic&lt;/li&gt;
&lt;li&gt;Building their payment gateway wrappers&lt;/li&gt;
&lt;li&gt;Configuring analytics dashboards manually&lt;/li&gt;
&lt;li&gt;Coding email flows from scratch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By the time they finish...&lt;br&gt;&lt;br&gt;
👉 &lt;strong&gt;They haven’t launched.&lt;br&gt;&lt;br&gt;
👉 They haven’t tested the idea.&lt;br&gt;&lt;br&gt;
👉 They haven’t talked to a single user.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 The API-First MVP Stack That Works
&lt;/h2&gt;

&lt;p&gt;Here’s the battle-tested tech I use to accelerate MVP builds without sacrificing quality:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;🔧 Feature&lt;/th&gt;
&lt;th&gt;🧩 API/Service&lt;/th&gt;
&lt;th&gt;💡 Why I Use It&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Payments&lt;/td&gt;
&lt;td&gt;Stripe / PayPal&lt;/td&gt;
&lt;td&gt;Easy setup, scalable, secure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Auth&lt;/td&gt;
&lt;td&gt;Auth0 / Firebase Auth&lt;/td&gt;
&lt;td&gt;Social login, 2FA, role-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Location&lt;/td&gt;
&lt;td&gt;Google Maps API&lt;/td&gt;
&lt;td&gt;Live tracking, distances&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Analytics&lt;/td&gt;
&lt;td&gt;Plausible / GA4&lt;/td&gt;
&lt;td&gt;Real-time usage data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Emails&lt;/td&gt;
&lt;td&gt;SendGrid / Resend&lt;/td&gt;
&lt;td&gt;Transactional emails, scalable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These tools handle the &lt;strong&gt;infrastructure&lt;/strong&gt;, &lt;strong&gt;security&lt;/strong&gt;, and &lt;strong&gt;compliance&lt;/strong&gt; — so I can focus on building what makes your product &lt;em&gt;different&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ My Personal API Vetting Checklist
&lt;/h2&gt;

&lt;p&gt;Before I plug any API into an MVP, I run through this checklist:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Is the documentation beginner-friendly?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Does it offer a free tier or low startup cost?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Are there SDKs for both frontend and backend?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Can I replace it later if needed?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Does it introduce latency or performance issues?&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You don’t want to be stuck with a vendor lock-in or poor DX down the line.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧪 Real Example: 3-Day MVP Launch
&lt;/h2&gt;

&lt;p&gt;A solo founder I recently worked with wanted to test a subscription-based micro-SaaS idea.&lt;/p&gt;

&lt;p&gt;Instead of building a full stack from scratch, we used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stripe Checkout for payments&lt;/li&gt;
&lt;li&gt;Firebase Auth for login&lt;/li&gt;
&lt;li&gt;SendGrid for user emails&lt;/li&gt;
&lt;li&gt;Google Analytics for usage tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We shipped a working MVP in &lt;strong&gt;3 days.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
It’s now collecting early feedback and converting users. All without any custom backend auth or payment logic.&lt;/p&gt;




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

&lt;p&gt;When you're in the MVP phase, it's not about being clever — it's about being &lt;strong&gt;resourceful&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"APIs are shortcuts that let you focus on what really matters: solving the user’s core problem."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So if you're a founder, PM, or indie hacker:&lt;br&gt;&lt;br&gt;
✅ Skip the unnecessary builds.&lt;br&gt;&lt;br&gt;
✅ Choose the right APIs.&lt;br&gt;&lt;br&gt;
✅ Ship smarter.&lt;/p&gt;

&lt;p&gt;And if you're looking to go from idea to product — fast and lean — I’d love to connect.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Let’s Connect
&lt;/h2&gt;

&lt;p&gt;You can find me here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/asadbukhari1/" rel="noopener noreferrer"&gt;LinkedIn – Asad Bukhari&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Or drop a comment if you’ve got API tips or questions to share.&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>api</category>
      <category>saas</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Future of Login Systems: Biometric Authentication</title>
      <dc:creator>Asad Bukhari</dc:creator>
      <pubDate>Fri, 14 Feb 2025 21:06:11 +0000</pubDate>
      <link>https://dev.to/asadbukhari/biometric-authentication-in-web-mobile-apps-the-future-of-login-systems-3n0b</link>
      <guid>https://dev.to/asadbukhari/biometric-authentication-in-web-mobile-apps-the-future-of-login-systems-3n0b</guid>
      <description>&lt;p&gt;For years, passwords have been the go-to method for authentication. But let’s be honest—they’re far from perfect. People forget them, reuse them across platforms, and hackers constantly find ways to steal them.&lt;/p&gt;

&lt;p&gt;This is where biometric authentication and modern identity solutions, such as SSO (Single Sign-On), are revolutionizing the security of access to web and mobile applications.&lt;/p&gt;

&lt;p&gt;Let’s dive into why biometrics are the future, how they work, best practices for implementation, and how industry leaders leverage them.&lt;/p&gt;

&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%2Fa0axvi5bw9weldv1nuor.jpg" 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%2Fa0axvi5bw9weldv1nuor.jpg" alt="biometric authentication gives ease to login to multiple platforms without remembering passwords" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Biometric Authentication?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Better Security:&lt;/strong&gt; Your face, fingerprint, or voice is unique—far harder to replicate than a password. Even if someone gains access to your login credentials, they won’t have your biometric data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Frictionless Experience:&lt;/strong&gt; No more forgotten passwords or annoying resets. Biometric logins take just seconds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reduced Fraud &amp;amp; Identity Theft:&lt;/strong&gt; With advancements in liveness detection, biometric systems prevent spoofing attacks (e.g., someone using a photo to bypass face recognition).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compliance &amp;amp; Multi-Factor Authentication (MFA):&lt;/strong&gt; Many industries are adopting biometric authentication as part of their security protocols, meeting regulatory requirements like PSD2 (banking) and HIPAA (healthcare).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result? Faster, safer, and more efficient authentication systems.&lt;/p&gt;

&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%2Fjqhwl2315phlsv7wj8bq.jpg" 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%2Fjqhwl2315phlsv7wj8bq.jpg" alt="Secure your accounts payments and data using biometric verification" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Biometric Authentication Works
&lt;/h2&gt;

&lt;p&gt;Biometric authentication is built on three core steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enrollment:&lt;/strong&gt; The system captures a unique biometric trait (e.g., fingerprint, face, iris) and converts it into a mathematical representation (not an actual image).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Storage &amp;amp; Encryption:&lt;/strong&gt; The biometric template is encrypted and stored either on the device (secure enclave) or on a secure server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verification:&lt;/strong&gt; When logging in, the system compares the live biometric input with the stored template. If it matches, access is granted.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Biometric data is never stored as raw images—it’s transformed into unique patterns that are useless if stolen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Considerations: Are Biometrics Truly Safe?
&lt;/h2&gt;

&lt;p&gt;While biometric authentication is stronger than passwords, it’s not 100% foolproof. Here’s what to consider:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Biometric Data is Permanent&lt;/strong&gt; – Unlike passwords, you can’t change your face or fingerprint. If stolen, it’s compromised for life.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Storage Matters&lt;/strong&gt; – Tech leaders (like Apple &amp;amp; Google) use on-device storage instead of cloud-based systems, preventing large-scale biometric data breaches.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Anti-Spoofing Mechanisms&lt;/strong&gt; – Advanced biometric systems now detect deepfakes, 3D masks, and synthetic fingerprints.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Best Practice?&lt;/strong&gt; Always combine biometrics with another factor (like a PIN or device authentication) for extra security.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Big Tech is Using Biometrics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Apple (Face ID &amp;amp; Touch ID):&lt;/strong&gt; &lt;a href="https://support.apple.com/guide/security/secure-enclave-sec59b0b31ff/web" rel="noopener noreferrer"&gt;Apple’s Secure Enclave&lt;/a&gt; ensures fingerprint and facial data never leave the device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Google (Android Biometric API):&lt;/strong&gt; &lt;a href="https://source.android.com/docs/security/features/biometric" rel="noopener noreferrer"&gt;Google&lt;/a&gt; integrates biometrics into Android devices, allowing apps to authenticate users with fingerprints and face scans.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Microsoft (&lt;a href="https://support.microsoft.com/en-us/windows/configure-windows-hello-dae28983-8242-bb2a-d3d1-87c9d265a5f0" rel="noopener noreferrer"&gt;Windows Hello&lt;/a&gt;):&lt;/strong&gt; Offers passwordless login with facial recognition, iris scans, and fingerprint authentication.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Banking Apps:&lt;/strong&gt; Many financial institutions are now adopting &lt;a href="https://www.iso.org/obp/ui/en/#iso:std:iso:19092:ed-2:v1:en" rel="noopener noreferrer"&gt;biometric authentication&lt;/a&gt; for mobile banking apps due to their security and ease of use.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The takeaway? &lt;strong&gt;Biometric authentication&lt;/strong&gt; is not just a trend—it’s a standard in modern security.&lt;/p&gt;

&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%2Fv6nnekw7sh2l3h8b8d7l.jpg" 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%2Fv6nnekw7sh2l3h8b8d7l.jpg" alt="save yourself with biometric verification by asad bukhari developer" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Want to Dive Deeper? Recommended Books &amp;amp; Papers
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Research Papers &amp;amp; Articles:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deep Learning-Based Biometric Authentication: &lt;a href="https://arxiv.org/abs/2003.04857" rel="noopener noreferrer"&gt;A Survey&lt;/a&gt;&lt;/strong&gt; – A review of modern biometric authentication techniques.&lt;br&gt;
&lt;strong&gt;&lt;a href="https://www.sciencedirect.com/topics/computer-science/biometric-authentication" rel="noopener noreferrer"&gt;Biometric Security&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Biometric authentication is changing the way we secure access to digital platforms. With improved security, seamless UX, and adoption by industry leaders, it’s clear that passwords are becoming a thing of the past.&lt;/p&gt;

&lt;p&gt;However, privacy concerns and security risks still exist, making ethical implementation and proper encryption critical.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;💬 What are your thoughts? Do you trust biometric authentication, or do you still prefer passwords? Let’s discuss this in the comments! 👇 *&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>computerscience</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Edit Commit Messages: Amending Git Commits</title>
      <dc:creator>Asad Bukhari</dc:creator>
      <pubDate>Tue, 03 Sep 2024 19:10:47 +0000</pubDate>
      <link>https://dev.to/asadbukhari/how-to-fix-mistakes-in-commit-messages-amending-git-commits-11io</link>
      <guid>https://dev.to/asadbukhari/how-to-fix-mistakes-in-commit-messages-amending-git-commits-11io</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In the world of version control, commit messages are like a logbook for your project's history. They help you and your team understand what changes were made and why. However, it's common to make mistakes in commit messages—whether it’s a typo, an unclear description, or a misleading statement. Thankfully, Git provides several ways to correct these mistakes. This blog post will guide you through the process of amending commit messages, ensuring that your commit history remains clean and accurate.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Understanding Commit Messages&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why Good Commit Messages Matter&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Good commit messages are crucial for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clarity&lt;/strong&gt;: They provide context about why changes were made, which is essential for future reference.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Not Clear Message&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "login up"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Clear Message&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "Add user authentication: Implemented login and signup functionality with JWT"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration&lt;/strong&gt;: Clear messages help team members understand each other's work and make collaboration more effective.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Common Mistakes in Commit Messages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Typos&lt;/strong&gt;: Simple spelling or grammatical errors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Incomplete Descriptions&lt;/strong&gt;: Messages that don’t fully explain the changes made.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Misleading Information&lt;/strong&gt;: Commit messages that don’t accurately reflect the content of the commit.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Amending the Most Recent Commit
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Scenario: Fixing a Recent Commit Message&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;You can easily amend if you’ve just committed and realized an issue with the commit message. This is useful for quick corrections without altering the overall commit history.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Command and Explanation&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;To fix the most recent commit message, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit --amend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;How to Use&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Run the Command:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit --amend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Edit the Commit Message:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;  An editor will open with the existing commit message.&lt;/li&gt;
&lt;li&gt;  Modify the message as needed.&lt;/li&gt;
&lt;li&gt;  Save and close the editor to update the commit message.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Example&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Original commit message 
git commit -m "Fix typo in documentation" 

# Amending the commit message 
git commit --amend # Edit the message in the editor, then save and close
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Editor will look like this.&lt;/p&gt;

&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%2Fkfdknfpn7rva5sswxnhu.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%2Fkfdknfpn7rva5sswxnhu.png" alt="git commit --amend editor picture by asadbukhari" width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll need to edit or rewrite the existing commit message. In my case, the message was "readme updated," which I then changed to the desired message.&lt;/p&gt;

&lt;p&gt;When the editor opens in my case, it's Vim as my terminal editor you can press &lt;code&gt;i&lt;/code&gt; to enter Insert Mode. Once in Insert Mode, you'll see "INSERT" at the bottom of the screen, allowing you to modify or update the commit message as needed.&lt;/p&gt;

&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%2Fywrq2idx82oattlowg54.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%2Fywrq2idx82oattlowg54.png" alt="git amend editor by asadbukhari" width="800" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once Updated press the &lt;code&gt;ESC&lt;/code&gt; key and then &lt;code&gt;:wq&lt;/code&gt; and hit &lt;code&gt;Enter&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ESC&lt;/code&gt; will turn off insert mode and &lt;code&gt;:wq&lt;/code&gt; will write and quit your editor. It will ensure that each change will be written and saved.&lt;/p&gt;

&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%2Fuxk0wt28an9yq00okgnx.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%2Fuxk0wt28an9yq00okgnx.png" alt=":wq in commit --amend by asadbukhari" width="800" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pressing Enter will close the editor and the commit message is updated. &lt;br&gt;
use this command to see the commits.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&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%2Fr2i2b89ppan8yk145vig.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%2Fr2i2b89ppan8yk145vig.png" alt="git log command by asadbukhari" width="800" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Fixing mistakes in commit messages is essential for maintaining a clean and understandable project history. Git's &lt;code&gt;--amend&lt;/code&gt; feature provides a simple and effective way to correct recent commit messages, ensuring that your project's log remains accurate and informative. By following best practices and keeping your commit messages clear and descriptive, you enhance collaboration and make future maintenance much easier.&lt;/p&gt;

&lt;p&gt;There are many other methods and tools available for maintaining a clean commit history, such as interactive rebasing and commit squashing. I’ll be sharing more tips and techniques in my upcoming posts. Stay tuned!&lt;/p&gt;

&lt;p&gt;Connect with me:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/asadbukhari2" rel="noopener noreferrer"&gt;Github&lt;/a&gt;: - Explore my open-source projects and repositories.&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/asadbukhari1/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;: - Connect with me professionally and stay updated on my career.&lt;br&gt;
Feel free to reach out or follow me on these platforms for more insights, updates, and opportunities. Thanks for reading!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>github</category>
    </item>
    <item>
      <title>Switch Branches in Git Without Losing Your Work</title>
      <dc:creator>Asad Bukhari</dc:creator>
      <pubDate>Mon, 02 Sep 2024 20:28:23 +0000</pubDate>
      <link>https://dev.to/asadbukhari/switch-branches-in-git-without-losing-your-work-2o18</link>
      <guid>https://dev.to/asadbukhari/switch-branches-in-git-without-losing-your-work-2o18</guid>
      <description>&lt;p&gt;As developers, we often find ourselves in situations where we're deep into coding a feature when suddenly an urgent issue demands our immediate attention. To address it, we need to switch branches in Git. However, doing so can be risky if we haven't yet committed our current changes. We could lose our work or face merge conflicts.&lt;/p&gt;

&lt;p&gt;In this post, I'll walk you through two effective strategies to switch branches in Git without losing your changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Scenario
&lt;/h2&gt;

&lt;p&gt;Imagine you're working on a new feature in your current branch. You've made several changes, but you haven’t committed them yet. Suddenly, you receive a request to fix a bug in another branch. The dilemma: How do you switch to the other branch to address the issue without losing the changes you’ve made?&lt;/p&gt;

&lt;p&gt;Git provides a couple of powerful tools to handle this situation smoothly: &lt;code&gt;git stash&lt;/code&gt; and creating a temporary branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution 1: Using &lt;code&gt;git stash&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;What is &lt;code&gt;git stash&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git stash&lt;/code&gt; is a command that allows you to temporarily save (or "stash") your changes without committing them. This is useful when you need to switch branches but want to come back to your current work later without losing anything.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Use &lt;code&gt;git stash&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Here’s how you can stash your changes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Stash Your Changes:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Run the following command to stash your changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command saves your uncommitted changes and resets your working directory to match the last commit.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Switch to the Other Branch:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that your working directory is clean, you can safely switch to the other branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fix the urgent issue in the other branch as needed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Restore Your Stashed Changes:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you've addressed the issue, switch back to your original branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout &amp;lt;original-branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, restore your stashed changes with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash pop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command applies the stashed changes back to your working directory and removes the stash from your stash list.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Workflow
&lt;/h3&gt;

&lt;p&gt;Let's say you're working on a feature in the &lt;code&gt;feature-branch&lt;/code&gt;, and you receive a request to fix a bug in &lt;code&gt;master&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Save your changes using &lt;code&gt;git stash&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Switch to the &lt;code&gt;master&lt;/code&gt; branch:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Fix the bug in &lt;code&gt;master&lt;/code&gt; and commit your changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Switch back to &lt;code&gt;feature-branch&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout feature-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Restore your stashed changes:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash pop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you're back to where you left off, with all your changes intact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution 2: Committing Your Changes to a Temporary Branch
&lt;/h2&gt;

&lt;p&gt;Another approach is to commit your changes to a temporary branch. This is useful if you prefer committing your work before switching branches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Temporary Branch
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Create a Temporary Branch:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First, create and switch to a new temporary branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b temp-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This branch will hold your current work while you address the urgent issue.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Commit Your Changes:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Commit your work in the temporary branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add . &amp;amp;&amp;amp; git commit -m "WIP: Save work before switching branches"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Switch to the Other Branch:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, switch to the branch where you need to make the urgent changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Continuing Your Work
&lt;/h3&gt;

&lt;p&gt;Once you've resolved the issue:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Switch Back:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Return to your original branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout &amp;lt;original-branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Merge the Temporary Branch (Optional):&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to bring your work from the temporary branch back into your original branch, you can merge it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git merge temp-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Delete the Temporary Branch (Optional):&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you're done, you can delete the temporary branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -d temp-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example Workflow
&lt;/h3&gt;

&lt;p&gt;Let’s go through a quick example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Create and switch to a temporary branch:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b temp-fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Commit your current changes:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add . &amp;amp;&amp;amp; git commit -m "WIP: Temporary save before switching branches"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Switch to the required branch to fix the issue:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; After fixing the issue, switch back to your original branch:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout feature-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Optionally merge the temporary branch if needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Switching branches in Git can be smooth and stress-free, even with uncommitted changes. By leveraging git stash or creating a temporary branch, you can seamlessly manage your workflow and keep your progress intact. These techniques help you address urgent issues swiftly without losing any of your ongoing work.&lt;/p&gt;

&lt;p&gt;Try these methods in your next project and see how they can enhance your development process!&lt;/p&gt;

&lt;p&gt;I hope this guide on using git stash was helpful. If you have any questions or need further details, don’t hesitate to leave a comment below.&lt;/p&gt;

&lt;p&gt;Stay tuned for more methods in my upcoming blogs—there's much more to explore!&lt;/p&gt;

&lt;p&gt;Connect with me:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/asadbukhari2" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;: - Explore my open-source projects and repositories.&lt;br&gt;
&lt;a href="//linkedin.com/in/asadbukhari1"&gt;LinkedIn&lt;/a&gt;: - Connect with me professionally and stay updated on my career.&lt;br&gt;
Feel free to reach out or follow me on these platforms for more insights, updates, and opportunities. Thanks for reading!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>git</category>
    </item>
  </channel>
</rss>
