This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x5ad29c5eFf82dAB06267F44c7Ef1864004A7605e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initializes the `/mailer` service on path `/mailer` | |
const hooks = require('./mailer.hooks'); | |
const Mailer = require('feathers-mailer'); | |
const smtpTransport = require('nodemailer-smtp-transport'); | |
module.exports = function (app) { | |
app.use('/mailer', Mailer(smtpTransport({ | |
host: 'email-smtp.us-east-1.amazonaws.com', | |
secure: true, | |
auth: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initializes the `authmanagement` service on path `/authmanagement` | |
const authManagement = require('feathers-authentication-management'); | |
const hooks = require('./authmanagement.hooks'); | |
const notifier = require('./notifier'); | |
module.exports = function (app) { | |
// Initialize our service with any options it requires | |
app.configure(authManagement(notifier(app))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(app) { | |
function getLink(type, hash) { | |
const url = 'http://localhost:3030/' + type + '?token=' + hash | |
return url | |
} | |
function sendEmail(email) { | |
return app.service('mailer').create(email).then(function (result) { | |
console.log('Sent email', result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { authenticate } = require('@feathersjs/authentication').hooks; | |
const verifyHooks = require('feathers-authentication-management').hooks; | |
const accountService = require('../authmanagement/notifier'); | |
const { | |
hashPassword, protect | |
} = require('@feathersjs/authentication-local').hooks; | |
module.exports = { | |
before: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<p id = "info"> | |
Sending token | |
</p> | |
<script> | |
var url = new URL(window.location.href); | |
var token = url.searchParams.get("token"); | |
var obj = { | |
action: 'verifySignupLong', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before: { | |
all: [], | |
find: [ authenticate('jwt') ], | |
get: [ authenticate('jwt') ], | |
create: [ | |
hashPassword(), | |
verifyHooks.addVerification() | |
], | |
update: [ | |
commonHooks.disallow('external') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "tutorial-graphql", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"dev": "nodemon ./index.js --exec babel-node", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Imre Gelens", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
"es2015" | |
], | |
"plugins": [ | |
"syntax-async-functions", | |
"transform-regenerator" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoose from "mongoose"; | |
const Schema = mongoose.Schema; | |
const productSchema = new Schema({ | |
name: {type:String}, | |
description: {type:String}, | |
image: {type:String}, | |
price: {type:Number} | |
}, {collection:"products"}); // Defining the collection is redundant in this case. |
OlderNewer