Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🍕 Add preventAuth parameter #40

Merged
merged 11 commits into from
Feb 10, 2025
Merged

🍕 Add preventAuth parameter #40

merged 11 commits into from
Feb 10, 2025

Conversation

jjpaulino
Copy link
Member

@jjpaulino jjpaulino commented Feb 5, 2025

This PR introduces a flag that, when true, will prevent users from either going into edit mode or making any edits to a page they had already opened in edit mode in their browsers. This environment variable is optional and you can set it up from your Clay instance and it'll be picked up here since it'll share the same env file!

image

@jjpaulino jjpaulino self-assigned this Feb 5, 2025
index.js Outdated
@@ -39,6 +39,9 @@ function isProtectedRoute(req) {
*/
function isAuthenticated(site) {
return function (req, res, next) {
// eslint-disable-next-line no-constant-condition
if (process.env.PREVENT_AUTH || true) return res.redirect(`${getAuthUrl(site)}/login`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add this here?

module.exports.AUTH_LEVELS = {
and we can ensure the string env var is cast to a bool and default it to false.

@@ -102,12 +102,6 @@ workflows:
version: 2
test:
jobs:
- test_node10:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the circleci files so it doesn't fail and notify everyone who's listening lol
I'll add an issue to redo this with github actions.

@@ -4,6 +4,15 @@
<meta charset="utf-8">
<title>Log In - Clay</title>
<style>
@keyframes fadeIn {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a small animation to the maintenance message just because.

localAuthPath: `${authUrl}/local`,
useLocalAuth: providers.includes('local')
logoutLink: `${authUrl}/logout`,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-ordered alphabetically

Copy link
Member

@james-owen james-owen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COOL

Copy link

@alhansrisuk alhansrisuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@jjpaulino jjpaulino merged commit 467d3a8 into master Feb 10, 2025
@jjpaulino jjpaulino deleted the jordan/prevent-auth branch February 10, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants