<?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 Tanitoluwa Adenuga on Medium]]></title>
        <description><![CDATA[Stories by Tanitoluwa Adenuga on Medium]]></description>
        <link>https://medium.com/@tanitoluwaadenuga?source=rss-48247a73f4fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iUKPlgrVad-RHznAkPm_0g.jpeg</url>
            <title>Stories by Tanitoluwa Adenuga on Medium</title>
            <link>https://medium.com/@tanitoluwaadenuga?source=rss-48247a73f4fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:58:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tanitoluwaadenuga/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[localStorage, sessionStorage and cookies: The Auth Token Decision Most Tutorials Get Wrong]]></title>
            <link>https://medium.com/@tanitoluwaadenuga/localstorage-sessionstorage-and-cookies-the-auth-token-decision-most-tutorials-get-wrong-0d0b90fcd7c2?source=rss-48247a73f4fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d0b90fcd7c2</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Tanitoluwa Adenuga]]></dc:creator>
            <pubDate>Mon, 24 Aug 2026 23:00:29 GMT</pubDate>
            <atom:updated>2026-08-24T23:00:29.127Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Most tutorials teach localStorage first. Here is what they leave out.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88ppLW3EhambmLIb_ibftw.png" /></figure><p>Most tutorials teach localStorage first. Some mention sessionStorage as the safer upgrade. Very few talk about what actually happens when your token is readable by any script on the page.</p><p>I know this because I went through all three the wrong way before I understood what the right choice actually was.</p><p>And the first thing I had to unlearn was something I had believed for a long time, that cookie based authentication and token based authentication were two different things. Like you had to choose one or the other.</p><p>A cookie is not a type of authentication. It is just a place to put your token.</p><p><em>Token answers: what proves you’re authenticated?</em></p><p><em>Cookie answers: where does that token live?</em></p><p>You can store a JWT in a cookie. In fact, that is exactly what you should do. “Cookie based auth” just means your token lives in a cookie instead of localStorage or sessionStorage. The two ideas don’t compete. They work together.</p><p>Once that clicked, everything else made sense.</p><p><strong>The Three Places Your Token Can Live</strong></p><p>Before I understood cookies, I went through the other two first.</p><p>localStorage was my default for a long time. Not because I had thought carefully about it. Just because everyone seemed to be using it. It was simple, it persisted across tabs and browser closes, and the API was straightforward. localStorage.setItem(&quot;token&quot;, value) and you were done. I didn&#39;t question it much.</p><p>Then I learned about sessionStorage and thought I had upgraded. The key difference that appealed to me was that once the tab closes, the stored token is gone and that felt safer.</p><p>What I did not fully appreciate yet is that both localStorage and sessionStorage share the same fundamental weakness: any JavaScript running on your page can read them. That includes your code, but also injected scripts, compromised dependencies, and malicious browser extensions. If an attacker finds a way to run script on your page, your token is readable.</p><p>That is known as XSS, Cross Site Scripting. It is one of the most common ways frontend applications get compromised, and most developers don’t think about it until something goes wrong.</p><p>sessionStorage’s shorter lifetime reduces the window slightly. But it doesn’t close it.</p><p>Cookies felt like a completely different world. And in one specific way, they are. When you set a cookie with the HttpOnly flag, JavaScript cannot read it at all. Not your code, not injected scripts, not anything running in the browser. The browser sends it automatically with every matching request, but it is invisible to JavaScript entirely.</p><p>That is the trade off that matters. You give up the ability to read your own token from the frontend. In exchange, you make it impossible to steal via XSS.</p><p>For an auth token, that is a trade worth making every time.</p><p><strong>🍪 Cookie Attributes That Actually Matter</strong></p><p>A cookie set by the backend is not just a string that appears in your browser. The attributes attached to it by the server are what determine whether it is actually secure, and whether your frontend requests even work at all.</p><p>These are the ones that matter for authentication :</p><p>HttpOnly</p><p>This is the most important one. An HttpOnly cookie cannot be read by JavaScript. Not even by your own frontend code. document.cookie won’t show it. No script on the page can touch it.</p><p>This is exactly what protects you from XSS token theft. If the token is in an HttpOnly cookie, an attacker who injects script into your page gets nothing. The token is invisible to them.</p><p>The trade off is that your frontend can not read the token either. You can not decode it to get the user’s role or check expiry on the client side. Instead, keep a small non-sensitive user profile in sessionStorage for the UI. Then treat a 401 response from the server as the real source of truth for whether someone is authenticated.</p><p>Secure</p><p>A Secure cookie is only sent over HTTPS. Over plain HTTP, the browser silently drops it. No error, no warning. It just doesn’t get sent.</p><p>This is the one that caught me in the real world. Everything worked perfectly on localhost because browsers treat <a href="http://localhost/">http://localhost</a> as a secure context. The moment the app hit an HTTP test server, the cookie stopped being sent entirely. No obvious error. Just requests failing as if the user wasn’t logged in.</p><p>The fix is straightforward: serve every environment over HTTPS. Not just production. Every environment.</p><p>SameSite</p><p>This one controls whether the cookie is sent on cross-site requests. It is your main defence against CSRF, which stands for Cross-Site Request Forgery.</p><p>Three options</p><p>Strict: cookie only sent on same-site navigation. Safest, but can cause issues when users arrive from external links.</p><p>Lax: sent on top level navigations. Good default for most apps. None: sent on all requests including cross-site. Requires</p><p>Secure. Needed when your frontend and API are on different domains.</p><p><strong>🚀 What I Do Now</strong></p><p>This is where I land now on every new project:</p><p>For auth tokens, always cookies.</p><p>The backend sets them server-side with HttpOnly; Secure; SameSite=Lax as the baseline. As the frontend engineer, your job is to make sure your requests include credentials and that you are not trying to read or manipulate the cookie yourself. If your frontend and API are on different origins, work with your backend team to switch to SameSite=None; Secure and configure CORS properly.</p><p>Never touch the token from the frontend. Do not try to read, decode, or check it. Send your requests with credentials: “include” and let the browser handle it automatically:</p><p>fetch(&quot;/api/protected-route&quot;, { credentials: &quot;include&quot; });</p><p>If the server returns a 401, clear your local UI state and redirect to login. That’s your source of truth, not anything stored client-side.</p><p>For non-sensitive UI state, sessionStorage or localStorage is fine.</p><p>Things like the user’s name, email, display role. Nothing sensitive, just what you need to render the UI.</p><p><strong>🔑 If I Could Go Back</strong></p><p>I would tell myself this:</p><p>localStorage, sessionStorage, and cookies are not three ways to do the same thing. They answer different questions entirely.</p><p>localStorage and sessionStorage ask: how long should this data stick around?</p><p>Cookies ask: should JavaScript be allowed to touch this at all?</p><p>For auth tokens, that second question is the only one that matters.</p><p>HttpOnly cookies don’t care how long your session lasts or how many tabs you have open. They just make sure that if someone finds a way to run malicious script on your page, they leave empty handed.</p><p>Switching between localStorage and sessionStorage, I thought I made a better security choice, turns out I was just rearranging the same problem.</p><p>The real answer was cookies. I just had not worked with them yet.</p><p>So the next time someone asks you where to store an auth token, you already know.</p><p>And you’ve got this ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d0b90fcd7c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[localStorage, sessionStorage, and cookies: The Auth Token Decision Most Tutorials Get Wrong]]></title>
            <link>https://medium.com/@tanitoluwaadenuga/localstorage-sessionstorage-and-cookies-the-auth-token-decision-most-tutorials-get-wrong-09dece9e1736?source=rss-48247a73f4fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/09dece9e1736</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Tanitoluwa Adenuga]]></dc:creator>
            <pubDate>Mon, 10 Aug 2026 13:30:42 GMT</pubDate>
            <atom:updated>2026-08-10T13:30:42.478Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88ppLW3EhambmLIb_ibftw.png" /></figure><p>Most tutorials teach localStorage first. Some mention sessionStorage as the safer upgrade. Very few talk about what actually happens when your token is readable by any script on the page.</p><p>I know this because I went through all three the wrong way before I understood what the right choice actually was.</p><p>And the first thing I had to unlearn was something I had believed for a long time, that cookie based authentication and token based authentication were two different things. Like you had to choose one or the other.</p><p>A cookie is not a type of authentication. It is just a place to put your token.</p><p><em>Token answers: what proves you’re authenticated?</em></p><p><em>Cookie answers: where does that token live?</em></p><p>You can store a JWT in a cookie. In fact, that is exactly what you should do. “Cookie based auth” just means your token lives in a cookie instead of localStorage or sessionStorage. The two ideas don’t compete. They work together.</p><p>Once that clicked, everything else made sense.</p><p><strong>🗄️ The Three Places Your Token Can Live</strong></p><p>Before I understood cookies, I went through the other two first.</p><p>localStorage was my default for a long time. Not because I had thought carefully about it. Just because everyone seemed to be using it. It was simple, it persisted across tabs and browser closes, and the API was straightforward. localStorage.setItem(&quot;token&quot;, value) and you were done. I didn&#39;t question it much.</p><p>Then I learned about sessionStorage and thought I had upgraded. The key difference that appealed to me was that once the tab closes, the stored token is gone and that felt safer.</p><p>What I did not fully appreciate yet is that both localStorage and sessionStorage share the same fundamental weakness: any JavaScript running on your page can read them. That includes your code, but also injected scripts, compromised dependencies, and malicious browser extensions. If an attacker finds a way to run script on your page, your token is readable.</p><p>That is known as XSS, Cross Site Scripting. It is one of the most common ways frontend applications get compromised, and most developers don’t think about it until something goes wrong.</p><p>sessionStorage’s shorter lifetime reduces the window slightly. But it doesn’t close it.</p><p>Cookies felt like a completely different world. And in one specific way, they are. When you set a cookie with the HttpOnly flag, JavaScript cannot read it at all. Not your code, not injected scripts, not anything running in the browser. The browser sends it automatically with every matching request, but it is invisible to JavaScript entirely.</p><p>That is the trade off that matters. You give up the ability to read your own token from the frontend. In exchange, you make it impossible to steal via XSS.</p><p>For an auth token, that is a trade worth making every time.</p><p><strong>🍪 Cookie Attributes That Actually Matter</strong></p><p>A cookie set by the backend is not just a string that appears in your browser. The attributes attached to it by the server are what determine whether it is actually secure, and whether your frontend requests even work at all.</p><p>These are the ones that matter for authentication :</p><p><strong>HttpOnly</strong></p><p>This is the most important one. An HttpOnly cookie cannot be read by JavaScript. Not even by your own frontend code. document.cookie won’t show it. No script on the page can touch it.</p><p>This is exactly what protects you from XSS token theft. If the token is in an HttpOnly cookie, an attacker who injects script into your page gets nothing. The token is invisible to them.</p><p>The trade off is that your frontend can not read the token either. You can not decode it to get the user’s role or check expiry on the client side. Instead, keep a small non-sensitive user profile in sessionStorage for the UI. Then treat a 401 response from the server as the real source of truth for whether someone is authenticated.</p><p><strong>Secure</strong></p><p>A Secure cookie is only sent over HTTPS. Over plain HTTP, the browser silently drops it. No error, no warning. It just doesn’t get sent.</p><p>This is the one that caught me in the real world. Everything worked perfectly on localhost because browsers treat <a href="http://localhost/">http://localhost</a> as a secure context. The moment the app hit an HTTP test server, the cookie stopped being sent entirely. No obvious error. Just requests failing as if the user wasn’t logged in.</p><p>The fix is straightforward: serve every environment over HTTPS. Not just production. Every environment.</p><p><strong>SameSite</strong></p><p>This one controls whether the cookie is sent on cross-site requests. It is your main defence against CSRF, which stands for Cross-Site Request Forgery.</p><p>Three options:</p><p><strong>Strict</strong>: cookie only sent on same-site navigation. Safest, but can cause issues when users arrive from external links.</p><p><strong>Lax</strong>: sent on top level navigations. Good default for most apps. None: sent on all requests including cross-site. Requires</p><p><strong>Secure</strong>. Needed when your frontend and API are on different domains.</p><p>🚀 <strong>What I Do Now</strong></p><p>This is where I land now on every new project:</p><p>For auth tokens, always cookies.</p><p>The backend sets them server-side with HttpOnly; Secure; SameSite=Lax as the baseline. As the frontend engineer, your job is to make sure your requests include credentials and that you are not trying to read or manipulate the cookie yourself. If your frontend and API are on different origins, work with your backend team to switch to SameSite=None; Secure and configure CORS properly.</p><p>Never touch the token from the frontend. Do not try to read, decode, or check it. Send your requests with credentials: “include” and let the browser handle it automatically:</p><p>fetch(&quot;/api/protected-route&quot;, { credentials: &quot;include&quot; });</p><p>If the server returns a 401, clear your local UI state and redirect to login. That’s your source of truth, not anything stored client-side.</p><p>For non-sensitive UI state, sessionStorage or localStorage is fine.</p><p>Things like the user’s name, email, display role. Nothing sensitive, just what you need to render the UI.</p><p><strong>🔑 If I Could Go Back</strong></p><p>I would tell myself this:</p><p>localStorage, sessionStorage, and cookies are not three ways to do the same thing. They answer different questions entirely.</p><p>localStorage and sessionStorage ask: how long should this data stick around?</p><p>Cookies ask: should JavaScript be allowed to touch this at all?</p><p>For auth tokens, that second question is the only one that matters.</p><p>HttpOnly cookies don’t care how long your session lasts or how many tabs you have open. They just make sure that if someone finds a way to run malicious script on your page, they leave empty handed.</p><p>Switching between localStorage and sessionStorage, I thought I made a better security choice, turns out I was just rearranging the same problem.</p><p>The real answer was cookies. I just had not worked with them yet.</p><p>So the next time someone asks you where to store an auth token, you already know.</p><p>And you’ve got this ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09dece9e1736" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your React App’s Security Starts Before You Write a Single Line of Code]]></title>
            <link>https://medium.com/@tanitoluwaadenuga/why-your-react-apps-security-starts-before-you-write-a-single-line-of-code-59513e880c92?source=rss-48247a73f4fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/59513e880c92</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Tanitoluwa Adenuga]]></dc:creator>
            <pubDate>Mon, 08 Jun 2026 11:09:30 GMT</pubDate>
            <atom:updated>2026-06-08T11:09:30.150Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*-dLtmSUb4vXlgEx4imSdNQ.png" /></figure><p><em>What working in a regulated industry taught me about thinking differently as a frontend engineer.</em></p><p>Before I moved into a regulated industry , I was storing entire user objects in session storage and calling it secure. The app worked. It passed review. It shipped.</p><p>Nobody flagged it — because in most startup and agency environments, nobody is looking for it. You move fast, features ship, and security is something you deal with “later.” Later usually never comes.</p><p>Moving into a regulated industry changed that completely.</p><p>Not because I became a different developer overnight, but because the environment demanded a level of scrutiny I hadn’t experienced before. Security was not a conversation that happened after something broke. It was baked into the process from the start. And that pressure, over time, rewired how I think.</p><p>At startups and agencies, the security conversation usually happens after something breaks. In a regulated environment it works differently. Before anything touches production, there are formal security reviews. A dedicated team actively tries to break your application, documents every weakness, and hands you a report. You fix everything before go live. Not most things. Everything.</p><p>The first time a report came back with frontend issues, I was genuinely surprised. Not because I thought I was a great security engineer — but because the things they flagged were things I had been doing casually for years and nobody had ever said a word.</p><h3>🔍 What I Didn’t Know I Was Getting Wrong</h3><p>The two things I kept getting pulled up on early in my career were insecure client-side storage and sensitive data exposed in the browser. Both felt embarrassing in hindsight — not because they were exotic mistakes, but because they were so ordinary.</p><p>I had been storing user data in session storage like it was a filing cabinet. Convenient, accessible, easy. What I hadn’t thought carefully enough about is that anything in session storage is readable — by the browser, by extensions, by anyone with access to the console. If you’re putting sensitive user information there, you’re not storing it. You’re leaving it out.</p><p>The role issue hit differently though. Once a JWT reaches the client, it can be decoded — the payload is just Base64. A user could take their decoded token, see something like &quot;role&quot;: &quot;user&quot;, and if your app is only checking that value on the frontend, the door is already open. I had been doing this without thinking twice. It wasn&#39;t until I worked somewhere that looked closely enough to notice that I understood why it mattered.</p><p>What surprised me most was not the vulnerabilities themselves. It was how invisible they were in normal development. Nobody catches these in a standard code review unless someone is specifically looking for them.</p><h3>🧠 How I Think About a New Feature Now</h3><p>The first question I ask before writing any code is: who has access to do what?</p><p>Not “how do I build this.” Not “what does the UI look like.” Who is allowed to see this, trigger this, or change this — and where exactly is that decision being enforced?</p><p>That question alone rules out a whole category of mistakes. If the answer is “the frontend checks the role and shows or hides things accordingly” — that’s a flag. The frontend can reflect access. It cannot define it.</p><p>From there I think about data. What am I putting in the browser and why? If something doesn’t need to be on the client, it shouldn’t be. Session storage, local storage, even React state — anything that lives in the browser is readable. I treat it that way from the start now, not after someone points it out.</p><p>Then I think about the flows. If this feature involves authentication or any kind of verification, what happens if someone intercepts the response? What happens if they manipulate it? Is the backend making the final call, or is it trusting what the client sends back?</p><p>These aren’t long conversations I have with myself. After a while they become instinct — a mental checklist that runs in the background before the first component gets written. Working in an environment where security failures have real consequences accelerated that instinct faster than any course or tutorial could have.</p><h3>💡 What Startup Developers Can Borrow From This Mindset</h3><p>You don’t need to work in a regulated environment to think like one.</p><p>Most startups and agencies aren’t running formal security reviews before every release — and that’s fine. But the mindset that makes high-stakes software secure isn’t expensive or complicated. It’s just a habit of asking uncomfortable questions early instead of late.</p><p>Ask who has access to do what before you build the feature. Ask what you’re putting in the browser and whether it actually needs to be there. Ask what happens if someone intercepts this response, manipulates this token, or replays this request. These questions cost nothing. Fixing the answers after the fact costs a lot more.</p><p>The other shift worth making is treating security as a first-class concern — not a final check before deployment, not a ticket that gets deprioritized when sprints get busy. Security doesn’t slow down development. Ignoring it does, just later and more painfully.</p><p>I was building things that worked. The apps functioned, users could log in, features shipped. But working and secure are not the same thing — and for a long time I didn’t feel the difference because nobody was looking closely enough to show me.</p><p>Something working doesn’t mean it’s the best thing to do. Security is as important as — sometimes more important than — what works.</p><p>It just took working somewhere that took it seriously for that to sink in.</p><blockquote>Enjoyed this? I also wrote about <a href="https://medium.com/@tanitoluwaadenuga/if-youve-ever-fought-a-cors-error-read-this-eb4326c3fc17">CORS errors and how to fix them</a> and <a href="https://medium.com/@tanitoluwaadenuga/building-secure-web-applications-why-trust-boundaries-matter-86add7b3264c">why trust boundaries matter in web security</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59513e880c92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Secure Web Applications: Why Trust Boundaries Matter]]></title>
            <link>https://medium.com/@tanitoluwaadenuga/building-secure-web-applications-why-trust-boundaries-matter-86add7b3264c?source=rss-48247a73f4fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/86add7b3264c</guid>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[two-factor-authentication]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[role-based-access-control]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Tanitoluwa Adenuga]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 14:50:59 GMT</pubDate>
            <atom:updated>2026-06-03T02:16:23.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RnCXuNAEghVt5CJUhMyILw.png" /></figure><p>Security is often treated as something to “tighten up” after features ship. In reality, security decisions shape the foundation of an application.</p><p>Most vulnerabilities don’t come from advanced attacks. They come from subtle trust mistakes , trusting the client too much, assuming a role value is safe, or believing that reaching a screen means a user is authorized.</p><p>Let’s look at two common pitfalls.</p><h3>🔑 Authentication Flows: The Frontend Is Not a Gatekeeper</h3><p>Two-Factor Authentication, typically a password plus an OTP is common in modern applications. The issue begins when the frontend decides whether verification succeeded.</p><p>In some implementations, the client checks a response like { &quot;verified&quot;: true } or simply relies on a 200 OK and proceeds. If the backend doesn&#39;t strictly enforce verification before issuing a token, that flow can be manipulated.</p><p>But here’s the thing that really made it click for me: once a token reaches the client, it can be decoded. And if a role or permission is sitting in that decoded payload with nothing enforcing it server-side, a user can manipulate it and walk into parts of the system they were never supposed to see.</p><p>The frontend can guide the experience. It should never be the one enforcing who gets in.</p><h3>🔒 Role-Based Access Control: Enforce at the Api Layer</h3><p>I experienced this firsthand working with JWTs. Once the token is on the client, it can be decoded (the payload is just Base64). A user could take their decoded token, see something like &quot;role&quot;: &quot;user&quot;, and if your app is only checking that value on the frontend, the door is already open.</p><p>The fix is straightforward but has to be deliberate. Bind roles to signed tokens and validate that signature on every protected request server-side. Not just on login, on every request. A valid signature means the token has not been tampered with. An invalid one should immediately reject the request, no questions asked.</p><pre>// ❌ Wrong — role check on the frontend only<br>if (user.role === &quot;admin&quot;) {<br>  return &lt;AdminDashboard /&gt;;<br>}<br><br>// ✅ Right — frontend reflects what the API already enforced<br>// Every sensitive API route validates the token server-side<br>// The UI just shows or hides based on what the backend already decided</pre><p>The UI should reflect permissions — not define them.</p><h3>🌐 Secure Systems Share Patterns</h3><p>After working across fintech products and enterprise banking systems, I have noticed the same patterns in every application that holds up under pressure.</p><p>Token lifetimes are short. Signing keys get rotated. Rate limiting is not an afterthought, it is on from day one. And nobody assumes that because a request made it through the frontend, it’s automatically legitimate.</p><p>The teams that get security right are not doing anything exotic. They are just consistent. Every layer does its own checking. No layer trusts the one before it blindly.</p><p>That’s defense in depth. Not a checklist, just a mindset.</p><p>If you want to go deeper, the OWASP Top 10 is worth reading cover to cover. Broken Access Control and Identification &amp; Authentication Failures are the two categories that cover almost everything we’ve discussed here.</p><h3><strong>🚀 Final Thoughts</strong></h3><p>Most vulnerabilities I have seen don’t come from sophisticated attacks. They come from someone trusting the wrong thing, the frontend, the client input, the fact that a user made it past a login screen.</p><p>Security gets better when you stop asking “how do I lock this down?” and start asking “what am I assuming here that I shouldn’t be?”</p><p>Define your trust boundaries early. Enforce them on the backend. And treat every client-side check as a UX courtesy, not a security control.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86add7b3264c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[If You’ve Ever Fought a CORS Error, Read This.]]></title>
            <link>https://medium.com/@tanitoluwaadenuga/if-youve-ever-fought-a-cors-error-read-this-eb4326c3fc17?source=rss-48247a73f4fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb4326c3fc17</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[cors]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tanitoluwa Adenuga]]></dc:creator>
            <pubDate>Thu, 27 Nov 2025 11:56:06 GMT</pubDate>
            <atom:updated>2026-06-03T02:01:51.785Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A developer-friendly guide to understanding CORS and fixing it with proxies in React, Vite, and Next.js.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixJTwxQltvGTaLDEOpVbdg.png" /></figure><blockquote><em>If you’ve ever opened your console and sighed, this will look familiar:</em></blockquote><pre>Access to fetch at &#39;…&#39; has been blocked by CORS policy…&#39;</pre><p>Postman works. Thunder Client works. Your backend developer swears everything is fine. But your browser? …not so much.</p><p>Let’s break down what’s actually happening — and how to fix it during development.</p><h3>🚧 What Exactly Is CORS?</h3><p>CORS (Cross-Origin Resource Sharing) is a browser security rule. Browsers only allow JS to call the same origin unless the backend explicitly says:</p><blockquote>“Yes, this site can call me.”</blockquote><p>An <strong>origin</strong> = protocol + domain/IP + port<br> Example:</p><pre>http://localhost:5173 ≠ http://10.21.21.242</pre><p>Requests between them get blocked. That’s why backend developers say “works on my machine” — the backend is fine, the browser is strict.</p><h3>🤨 Why Postman Works but Your Browser Doesn’t</h3><p>Postman is not a browser; it doesn’t enforce CORS.<br> CORS exists to protect users, not developers. Without it, any site could secretly call APIs on your behalf.</p><p>Annoying? Yes.<br> Necessary? Also yes.</p><h4>🪄 The Real Solution During Development : Use a Proxy</h4><p>You could configure the backend, but during development, a dev proxy is faster and safer.</p><p><strong>Browser → Dev server → Backend</strong></p><p>The browser thinks it’s talking to the same origin. CORS never triggers.</p><p>Think of it like this: instead of you walking up to a bouncer who doesn’t know you, your friend who is already on the list walks up and says “they are with me.” Same destination, different entry point. The browser sees localhost → localhost and relaxes completely.</p><p>It feels like cheating — but it’s not. It’s just smart routing.</p><h4>💡 Pro Tip (From Painful Experience)</h4><p>Whether you’re using <strong>Vite (5173)</strong>, <strong>CRA (3000)</strong>, or another React dev server, your backend might allow CORS <strong>only for the default port</strong>.</p><p>⚠️ Run your app on a different port (5174, 5175, 3001, 3002)…<br> and boom — CORS error.</p><p>Spent hours debugging, only to realize…</p><p><strong>It was the port all along.</strong> 🙃</p><h3>🛠️ Fixing CORS in Modern React Environments</h3><h4>1️⃣ Create React App (CRA)</h4><pre>// src/setupProxy.js<br>const { createProxyMiddleware } = require(&quot;http-proxy-middleware&quot;);<br><br>module.exports = function (app) {<br>  app.use(<br>    &quot;/api&quot;,<br>    createProxyMiddleware({<br>      target: &quot;https://jsonplaceholder.typicode.com&quot;,<br>      changeOrigin: true,<br>      pathRewrite: { &quot;^/api&quot;: &quot;&quot; },<br>    })<br>  );<br>};</pre><h4>📦 Usage</h4><pre>fetch(&quot;/api/posts&quot;).then(r =&gt; r.json()).then(console.log);</pre><h3>2️⃣ Vite (JavaScript or TypeScript)</h3><pre>// vite.config.ts<br>import { defineConfig } from &quot;vite&quot;;<br>import react from &quot;@vitejs/plugin-react&quot;;<br><br>export default defineConfig({<br>  plugins: [react()],<br>  server: {<br>    proxy: {<br>      &quot;/api&quot;: {<br>        target: &quot;https://jsonplaceholder.typicode.com&quot;,<br>        changeOrigin: true,<br>        rewrite: (path) =&gt; path.replace(/^\/api/, &quot;&quot;),<br>      },<br>    },<br>  },<br>});</pre><h4>📦 Usage</h4><pre>fetch(&quot;/api/posts&quot;).then(res =&gt; res.json()).then(console.log);</pre><p><strong>🚀 What About Production?</strong></p><p>Dev proxies disappear after deployment. They’re a local convenience, not a production solution.</p><p>In production, CORS has to be solved properly — and honestly, most of the time that means a conversation with your backend team, not a frontend fix.</p><p>In my experience shipping React apps, the backend team configured the server to explicitly allow requests from the domains where the frontend was hosted. Once the right origins were whitelisted on the backend, everything worked.</p><p>That’s actually the correct approach. The frontend shouldn’t be routing around CORS in production — the backend should be deliberately opening the door to trusted origins only.</p><p>Your options in production:</p><ul><li><strong>Backend configures CORS headers</strong> — the right way. Backend whitelists your frontend domain explicitly, not *</li><li><strong>Next.js API routes</strong> — your frontend and “backend” live on the same origin, so CORS never triggers</li><li><strong>Nginx reverse proxy</strong> — routes frontend and backend requests through the same domain at the server level</li><li><strong>Serverless functions</strong> (Vercel, Netlify) — same idea as Next.js API routes, same-origin by design</li></ul><p>The pattern is always the same: make the browser think it’s talking to one origin, or tell the backend to trust your origin explicitly</p><h4><em>🔑 </em><strong><em>If you remember nothing else, here’s what really matters</em></strong></h4><ul><li><strong>Browsers are strict on purpose.</strong><br> CORS is a browser security rule, not a backend bug. That’s why Postman works and your app doesn’t.</li><li><strong>Dev proxies feel like magic</strong><br> They make the browser think it’s doing localhost → localhost, even when the request is secretly going elsewhere.<br> No cross-origin request = no CORS error.</li><li><strong>Proxy only works in development.</strong><br> In production, solve it properly by whitelisting your origins on the backend, or architect your app so the browser never sees a cross-origin request.</li><li><strong>Sometimes… it’s just the port.</strong><br> If your backend allows CORS only for 5173 or 3000, running your app on another port will break things, even if everything else is correct.</li></ul><p>Once you understand these, CORS stops being scary.<br> Still annoying but no longer mysterious.</p><p>So the next time your console screams<br> <strong>“Blocked by CORS policy”</strong>,<br> smile, you’ve got this ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb4326c3fc17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Still in My 20s, Now a Software Engineer]]></title>
            <link>https://medium.com/@tanitoluwaadenuga/still-in-my-20s-now-a-software-engineer-425492082484?source=rss-48247a73f4fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/425492082484</guid>
            <dc:creator><![CDATA[Tanitoluwa Adenuga]]></dc:creator>
            <pubDate>Sat, 21 Jun 2025 00:04:05 GMT</pubDate>
            <atom:updated>2025-06-21T00:05:40.484Z</atom:updated>
            <content:encoded><![CDATA[<p>If you read <em>The 20th Chronicles</em>, you probably remember me — confused, curious, scared, and trying to figure out who I was becoming.</p><p>Well, this is the continuation of that story.</p><h3>🛤️ From Confused to Curious</h3><p>At some point, between taking courses in <strong>digital marketing</strong>, <strong>sales</strong>, and every other “maybe this is it” path, I started feeling the need to build — not just sell or market. I wanted to be part of the people who made the things I admired.</p><p>That shift in thought came slowly. Nothing fancy, no burning bush. Just curiosity… and exhaustion from jumping from one thing to the next.</p><p>My brother is a software engineer. One day, he shared some programming courses with me.</p><p>At that point, I didn’t even think I had the “tech brain.” But I decided to try.</p><p>I had this <strong>old Lenovo laptop</strong>. It wheezed when I opened too many tabs, the fan sounded like it was trying to take off 😂— but it worked.</p><p>And that’s how I started.<br> <strong>With fear, tears, and uncertainty.</strong><br> Sometimes, I cried during JavaScript tutorials. Other times, I sat in front of the screen, wondering if I was making a mistake.</p><p>But I kept going.</p><h3>🤲🏾 A Family That Believed in Me</h3><p>Another reason I didn’t give up?</p><p><strong>My family supported me.</strong><br> They didn’t always understand what I was doing, but they believed I was doing <em>something worthwhile</em>. That alone gave me the strength to try again every time I wanted to give up.</p><h3>🧱 Slowly, It Started to Make Sense</h3><p>Over time, I built small things.<br> The first time I made a button do what I told it to do, I felt like a wizard.<br> The first time I built a webpage and it didn’t break? I took screenshots and saved them like baby pictures.</p><p>And just like that, one line of code at a time, I became a software engineer.</p><p>Now I help train learners in our academy — it’s honestly one of the most fulfilling parts of my journey so far.</p><p>Watching someone go from <em>“I don’t get this”</em> to <em>“Omg it works!”</em> reminds me of my own beginning — my old laptop, my brother’s courses, and all the tears in between.</p><p>It feels like I’ve come full circle.<br> And I’m still growing.</p><h3>🔄 It’s Still Not a Straight Line</h3><p>I still have days when I feel unsure.<br> Imposter syndrome doesn’t completely go away.<br> But now I have something I didn’t before: <strong>evidence</strong>.<br> Evidence that I <em>can</em> learn. I <em>can</em> grow. I <em>can</em> build.</p><p>So no — this is not the end of my story. But it’s a good chapter.</p><p>From confused to coding.<br> From “what am I doing with my life?” to “yo, I built that.”</p><h3>💬 Why I’m Sharing This</h3><p>Because someone, somewhere, might be in their own <em>Chapter One</em> right now.<br> And I want you to know: it’s okay to start unsure.<br> It’s okay to start with a slow laptop and YouTube tutorials.<br> It’s okay to cry and try again.</p><p>Just don’t stop.</p><p>❤️ Yours in Progress,<br>Tani</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=425492082484" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 20th Chronicles]]></title>
            <link>https://medium.com/@tanitoluwaadenuga/the-20th-chronicles-9bd628fb90e?source=rss-48247a73f4fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bd628fb90e</guid>
            <category><![CDATA[nigerian]]></category>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[careerforwomen]]></category>
            <category><![CDATA[youth]]></category>
            <dc:creator><![CDATA[Tanitoluwa Adenuga]]></dc:creator>
            <pubDate>Tue, 31 Aug 2021 13:17:00 GMT</pubDate>
            <atom:updated>2021-08-31T13:17:00.195Z</atom:updated>
            <content:encoded><![CDATA[<p>The 20th Chronicles</p><p>Chapter One: Discovering Me<br> <br>The twenties is one of the most challenging phase of anyone&#39;s life.</p><p>This is the time you get to finish University and you are thinking what next?</p><p>People say oppurtunities come but once but I would say oppurtunities are everywhere but decisions are scarce and could be difficult especially for the confused generation out there of which I belong.</p><p>Getting to choose between this or that is one of the most challenging phase of one’s life and I am sure I can’t be the only one on this table.</p><p>I am a 22year old graduate of Biochemistry ,excellent grades completed service year ,2 years experience in Network marketing and B2C with vague career goals.</p><p>For the past seven Months ,I have changed career paths and job roles like 101times😂😂</p><p>This is actually funny and not so fuuny at the same time because I thought if studying a professional course like medicine or pharmacy would have given me a step by step guide for career advancement without the need to worry about the next step to take but now I know better ! Everything is not all black and white.</p><p>What is even worse is the pressure!!from parents,siblings .I get that this could be as a result of they wanting something good for me but then the pressure could get to the extreme and lead to a breakdown.</p><p>One thing I have learnt and I am still learning is that nobody had everything figured out all at once ..and this I am holding on to.</p><p>Line by line ,piece by piece ,life will make sense ..I might not see the light at the end of the tunnel now but this one life I have,It has to count!</p><p>Learn,Unlearn as much as you can and never stop learning.Money will come,the good things of life will come.These are the things I say to myself henceforth!</p><p>Uncles and Aunties, kindly remember that you were once like us and lessen the pressure you are throwing around.<br> <br>Thanks and God bless.</p><p>Signed:Confused Nigerian Youth</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bd628fb90e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>