Skip to main content

Skipping the Login Prompt for Anonymous Users

Workaround to skip the Login or Skip prompt when performing anonymous actions in the widget

Updated over 3 months ago

In some scenarios, you may want to maximize engagement by allowing anonymous users to submit posts or vote on existing ones without encountering the login prompt. By default, Sleekplan will trigger a login popup when a user performs an authentication-required action.

For use cases where anonymous posting and voting are the goal, this login prompt can feel like an unnecessary barrier that discourages participation.

👉 The following workaround uses a bit of custom JavaScript to automatically “skip” the login prompt whenever it appears. This creates a more seamless anonymous experience and can help increase user engagement.

The Code Snippet

Copy and paste the following script into your site or app

window.document.addEventListener('sleek:init', () => {        $sleek.on('user_auth_required', function () { setTimeout(() => { 
const iframe = document.getElementById('sleek-widget');
const link = iframe?.contentWindow?.document.querySelector('.login-skip > a');
if (link) { link.click(); }
}, 100);
});
}, false);

How it works

This snippet does three main things:

👉Waits for Sleekplan to Initialize

window.document.addEventListener('sleek:init', () => { ... });

Ensures the script runs only after the Sleekplan SDK is fully loaded.

👉Listens for the Login Prompt Event

$sleek.on('user_auth_required', function () { ... });

Hooks into the user_auth_required event, which is triggered whenever a user attempts an action that normally requires login.

👉Automatically Clicks "Skip"

const link = iframe?.contentWindow?.document.querySelector('.login-skip > a');
if (link) {
link.click();}

Finds the "Skip" link inside the Sleekplan widget and programmatically clicks it, bypassing the login prompt for the user.

Notes:

⚠️Unofficial Hack: This is not an officially supported Sleekplan feature. It’s

a workaround intended for specific use cases where anonymous engagement is the goal.

🔒 Authentication Disabled: With this in place, users will not be required to log in. Make sure this aligns with your community strategy and moderation needs.

🚀 Benefit: A smoother, barrier-free experience for users who only want to post or vote anonymously.







Did this answer your question?