Skip to content

SignUp,SignIn,Signout and email Validation for KeystoneJs

Notifications You must be signed in to change notification settings

Pkv9/keystone-enreg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enRaiser : Keystone-enreg

SignUp,SignIn,SignOut and email Validation for KeystoneJs.

Installation

  1. Create keystone project using yo keystone.

  2. Install keystone-enreg

    npm install git+https://[email protected]/enraiser/keystone-enreg.git
    

Usage

  1. In keystone.js at keystone.init add email template

    keystone.init({
         ……
        'emails': 'templates/emails',
        'siteurl': 'http://mysite.com/',
    }); 
  2. make sure you have set SITE_EMAIL_ADDRESS in .env file.

  3. In routes/index.js inside module.exports

    require('keystone-enreg').routes(app);
  4. Add welcome.jade at templates/emails

    block body-contents
        h1 Hi #{first_name},
        p.text-larger We would like to verify your EmailID to enroll you on #{brand}.
        p.text-larger click 
            a(href='#{link}') 
                strong this link
            |    to complete this verification.
  5. In User model add a boolean field called valid

      valid: { type: Boolean, initial: true},
  6. In default.jade change SignIn and SignOut links and add SignUp link

    if user
        if user.canAccessKeystone
            li: a(href='/keystone') Open Keystone
        li: a(href='/action/signout') Sign Out
    else
        li: a(href='/signin') Sign In
        li: a(href='/signup') Sign Up

About

SignUp,SignIn,Signout and email Validation for KeystoneJs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 76.9%
  • HTML 23.1%