<?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: Eduardo Orive Vinuesa</title>
    <description>The latest articles on DEV Community by Eduardo Orive Vinuesa (@edorka).</description>
    <link>https://dev.to/edorka</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F318554%2Fa58eabbf-31f7-4b2b-abb5-ba015f52b4a6.jpg</url>
      <title>DEV Community: Eduardo Orive Vinuesa</title>
      <link>https://dev.to/edorka</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/edorka"/>
    <language>en</language>
    <item>
      <title>Password column not included</title>
      <dc:creator>Eduardo Orive Vinuesa</dc:creator>
      <pubDate>Sun, 08 Nov 2026 12:09:35 +0000</pubDate>
      <link>https://dev.to/edorka/password-column-not-included-53bn</link>
      <guid>https://dev.to/edorka/password-column-not-included-53bn</guid>
      <description>&lt;p&gt;This will be very very strange statement to many readers. How an USERS table would miss such critical column? I hope in a few lines you can get the point of it.&lt;/p&gt;

&lt;p&gt;However strange, keeping the authentication out of your API databases could be a smart approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The platform is publicly accessible, by real people, programs or entities capable of making use of it.&lt;/li&gt;
&lt;li&gt;There is real chance that the platform is targeted to obtain it's sensitive data.&lt;/li&gt;
&lt;li&gt;The platform is distributed in different APIs, Web user's interfaces, processes, CLI tools, you name it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Well, and then, how we provide an authentication mechanism to access the platform?&lt;/p&gt;

&lt;p&gt;Use an identity and access management (IAM) such as Keycloak (however there are plenty of alternatives out there, also open source)&lt;/p&gt;

&lt;p&gt;Why take the overhead to use another service for authentication?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;These are reality proven secure services, afford that these teams and their investors can put much more resources to keep them safe.&lt;/li&gt;
&lt;li&gt;Their flexibility is something that you may not need, but if you finally find out you need third party authentication, applications, more than one realm, this will do.&lt;/li&gt;
&lt;li&gt;You can provide your own JWTs but if your platform is complex enough a authentication endpoint will be needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is however an issue of using this approach: JWTs are self-contained, so they stay valid until they expire — even after the user logs out. Common mitigations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Short-lived access tokens + refresh tokens; revoke the refresh token on logout.&lt;/li&gt;
&lt;li&gt;A denylist of revoked token ids (jti).&lt;/li&gt;
&lt;li&gt;If you need instant revocation, trade statelessness for Keycloak's token introspection endpoint (RFC 7662).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope this will help you if you didn't knew about it, for sure this was helpful for me.&lt;/p&gt;

</description>
      <category>jwt</category>
      <category>api</category>
      <category>security</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Preact SPA into a Wordpress theme</title>
      <dc:creator>Eduardo Orive Vinuesa</dc:creator>
      <pubDate>Tue, 18 Aug 2020 12:25:50 +0000</pubDate>
      <link>https://dev.to/edorka/preact-spa-into-a-wordpress-theme-lge</link>
      <guid>https://dev.to/edorka/preact-spa-into-a-wordpress-theme-lge</guid>
      <description>&lt;p&gt;Updated: Aug 19th, Found a solution that, however manual it's pretty clean and doesn't require adding new dependencies.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why?
&lt;/h1&gt;

&lt;p&gt;Recently I was asked to run a small web to hub the contents of a poetry event. Wordpress or Strapi were my first options but I don't feel confident with PHP to fully customize wordpress and I had no practice with Strapi at all.&lt;/p&gt;

&lt;p&gt;I have ran some test projects with Preact and it's CLI (&lt;a href="https://github.com/preactjs/preact-cli/" rel="noopener noreferrer"&gt;https://github.com/preactjs/preact-cli/&lt;/a&gt;) makes it pretty easy to start a SPA.&lt;/p&gt;

&lt;h1&gt;
  
  
  What?
&lt;/h1&gt;

&lt;p&gt;Given we have done an SPA capable of fetch Wordpress posts from it's API, and categories and all that; we still will have to manage with deployment and issues like CORS.&lt;/p&gt;

&lt;p&gt;The obvious solution is to use your SPA as a Wordpress Theme.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to do it myself?
&lt;/h1&gt;

&lt;p&gt;Imagine that our theme formal name is &lt;code&gt;preact-spa&lt;/code&gt;. We will store the output into the folder &lt;code&gt;wp-theme&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then, step by step:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;code&gt;preact-wp.config.js&lt;/code&gt; with this content:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import previous from './preact.config.js';

export default function (config, env, helpers) {
    config.output.publicPath = '/wp-content/themes/preact-spa/';
    previous(config, env, helpers);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we have to build it:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn build -c preact-wp.config.js --dest wp-theme
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;you can also run &lt;code&gt;npm run build ...&lt;/code&gt; if not using &lt;code&gt;yarn&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy or rename &lt;code&gt;wp-theme/index.html&lt;/code&gt; as &lt;code&gt;wp-theme/index.php&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are using css urls you may notice that the path to these files is not set to be under wp-content/... a barbarian but practical solution is to install &lt;code&gt;string-replace-loader&lt;/code&gt; as a development dependency and expand our &lt;code&gt;preact-wp.config.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import previous from './preact.config.js';

export default function (config, env, helpers) {
    const publicPath = '/wp-content/themes/nsp/';
    config.output.publicPath = publicPath;
    config.module.rules.push({
        test: /\.css/,
        loader: 'string-replace-loader',
        options: {
          search: /url\('\/assets\/(.*)?'\)/ig, 
          replace: (_match, resource) =&amp;gt; `url('${publicPath}assets/${resource}')`,
          flags: 'g',
        }
      });
    previous(config, env, helpers);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;create a new &lt;code&gt;wp-theme/style.css&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/*
Theme Name: Preact SPA
Author: Your Name
Author URI: https://github.com/your-github
Description: Create React WP Theme in no time
Version: 0.0.1
License: GPL
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: generated
Text Domain: your-domain

This theme, like WordPress, is licensed under the GPL.
*/
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[optional] Consider some cleanup before shipping:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm wp-theme/*map wp-theme/sw-debug.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Zip it to your Wordpress site and switch to this theme.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Issues?
&lt;/h1&gt;

&lt;p&gt;Sure, Creating a theme from running &lt;code&gt;yarn dev&lt;/code&gt; so it updates it self as the code changes. However I don't consider it really necessary.&lt;/p&gt;

&lt;h1&gt;
  
  
  Yes... But?
&lt;/h1&gt;

&lt;p&gt;Questions? Comments? Please comment below I would be happy to help.&lt;/p&gt;

</description>
      <category>preact</category>
      <category>wordpress</category>
      <category>theme</category>
      <category>node</category>
    </item>
  </channel>
</rss>
