Latest Updates

Documenting code, one commit at a time.

PHP Laravel

Preventing Scope Downgrades in OAuth Flows

Introduction

When implementing OAuth flows, ensuring that user permissions (scopes) are correctly managed is crucial. A subtle bug can lead to unintended scope downgrades, limiting the application's access to necessary resources. This post discusses a fix in the devlog-ist/landing project to prevent such downgrades during GitHub login.

The Problem

The devlog-ist/landing project

Read more

Fixing Alpine.js x-for Errors in SVG on Laravel Landing Pages

When building interactive landing pages with Laravel and Alpine.js, you might encounter unexpected issues when using Alpine.js directives inside SVG elements. Specifically, the <template x-for> loop can cause errors due to how browsers handle foreign objects within SVG. This post details a solution to this problem.

The Problem: <template x-for> Inside SVG

SVG elements have their own

Read more
PHP HTML CSS

Enhancing SEO on the Landing Project

The landing project aims to provide a public-facing website. We've been working on improving its search engine optimization (SEO). This ensures the site is easily discoverable and receives explicit indexing signals on every crawlable page.

The recent updates focused on adding meta robots directives to control indexing and following behavior, canonical URLs to avoid duplicate content issues,

Read more
PHP Laravel

Optimizing User Activity Sync in devlog-ist/landing

The devlog-ist/landing project is focused on [project description]. We've been working on improving how user activity is synced, specifically addressing limitations with the Events API. This involves handling date range restrictions and implementing a more robust commit synchronization strategy.

The Events API has a limited range of about 90 days and pagination caps, causing errors when syncing

Read more
JavaScript Laravel

CSRF Tokens: Preventing Onboarding Tour Issues

When building interactive tours, ensure all API requests include CSRF tokens to prevent unexpected failures. Let's look at a recent fix in Reimpact/platform, a project focused on modernizing user interaction flows. The team addressed an issue where the onboarding tour restarted on every page load.

The Problem: Missing CSRF Tokens

The tour's JavaScript fetch calls lacked the X-CSRF-TOKEN

Read more
PHP Laravel Filament

Handling GitHub API Token Revocation in devlog-ist/landing

The devlog-ist/landing project helps users track their development activity. We recently improved how the application handles revoked or expired GitHub API tokens. Previously, a 401 error would trigger a generic error log and continuous retry attempts during data synchronization. This led to unnecessary server load and delayed data updates.

Now, when a 401 error (Bad Credentials) is received

Read more
Laravel PHP OAuth

Limiting OAuth Providers in Laravel

Working on the devlog-ist/landing project, we're refining the authentication flow. The goal is to streamline user registration and login, particularly for non-developers who might be contributing recommendations. We've adjusted the available OAuth providers to match user roles.

Previously, both GitHub and LinkedIn were presented as default options on the login and registration pages.

Read more

Improving Queue Visibility in Laravel

We've enhanced the visibility of queue processing within our Laravel application, devlog-ist/landing, which provides a landing page. The goal was to make debugging and monitoring background jobs easier without relying on external tools.

Previously, queue events were mixed with other application logs, making it difficult to isolate and analyze queue-related issues.

Read more
Laravel PHP

Fixing Auto-Publishing in Laravel Project

We're working on a Laravel-based project, a landing page generator, where users can create and publish content. A recent update focused on ensuring the auto-publish feature for LinkedIn and Dev.to is reliably triggered.

The Problem

The core issue was that while the toggles for 'publish_on_linkedin' and 'publish_on_devto' correctly saved the desired publishing state to the Post model, the

Read more
PHP Laravel

Batch Processing for Auditing in Laravel

Working on the landing project (devlog-ist/landing), we're enhancing audit capabilities. A key improvement involves adding batch processing support for audit logs. This allows for more efficient handling of large volumes of audit data. The goal is to optimize performance and reduce processing time, especially when dealing with extensive logs.

To achieve this, we've implemented a Batchable trait

Read more