npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

apostrophe-signup

v2.0.5

Published

Lets the public sign up for accounts on a website powered by apostrophecms.

Downloads

15

Readme

apostrophe-signup

npm install apostrophe-signup
// in app.js
modules: {
  'apostrophe-signup': {
    // How long a signup email remains valid
    hours: 48,     
    // Apostophe group newly signed-up users are added to,
    // with optional permissions
    group: {
      title: 'signup',
      // Let them create apostrophe blog posts (which would need
      // to be a module enabled in your project) and upload files
      // to attach to them
      permissions: [ 'edit-apostrophe-blog', 'edit-attachment' ]
    },
    // defaults
    signupUrl: '/signup',
    signupConfirmUrl: '/signup-confirm',
    afterSignupUrl: '/',
    // Allow the user to enter a subset of the
    // fields in your `apostrophe-users` schema as
    // they are signing up. These are the defaults.

    // They will always be asked for their email address
    // and password. If you leave `username` off this list,
    // the user can only log in with their email address.
    fields: [ 'firstName', 'lastName', 'username' ],
    // Allow the user to enter a subset of the fields to be 
    // converted into required ones. By default only password
    // field is been converted to a required field.
    requiredFields: [ 'password' ]
  },

  // The apostrophe-email module must be configured
  'apostrophe-email': {
    // See the nodemailer documentation, many
    // different transports are available, this one
    // matches how PHP does it on Linux servers
    nodemailer: {
      sendmail: true,
      newline: 'unix',
      path: '/usr/sbin/sendmail'
    }
  }
}

Lets the public sign up for accounts. The user must receive an email at a unique address and confirm their account.

The apostrophe-email module must be configured. See sending email from your Apostrophe project.

Signing up

Try going to /signup.

Overriding and styling the signup page

You may override the views/signup.html template of this module by copying it to lib/modules/apostrophe-signup/views in your own project. As always, do not edit the copy in node_modules.

You may output the signup form markup yourself, but each input element must be nested in a "fieldset" element, which need not be of that type but must have the right data-name attribute. Inspect the standard markup to see what this looks like. Tolerance for changes of this kind varies from schema field type to schema field type.

Overriding the signup confirmation email

Copy views/signupEmail.html from this module to the lib/modules/apostrophe-signup/views/signupEmail.html folder of your own project. As usual, HTML in email is extremely limited, so keep your expectations basic. This has nothing to do with Apostrophe and everything to do with email clients.

If confirmation emails do not arrive

You need a better nodemailer configuration. The example configuration above assumes sendmail, postfix or a similar service is installed on your server and well-configured for reliable delivery. For best results, configure nodemailer to send mail via a legitimate account or, for higher volumes, via a trusted transactional email service like Postmark or Amazon Simple Email Service. For more information see sending email from your Apostrophe project.

If the signup form yields an error

As the message shown to the user says, this may be as simple as a duplicate email address or username. That is the most common reason.

However if this always occurs your nodemailer configuration might not be working at all. Review the server console error messages, and see above.

Giving the user special attention after signup

You can set the afterSignupUrl option to any URL you wish.

In addition, req.session.signup is set to true for the duration of the user's first session. You can detect this in middleware, pageBeforeSend, et cetera.