mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 21:34:24 +00:00
pw reset done
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
const path = require( 'path' );
|
||||
const db = require( '../db/db.js' );
|
||||
const fs = require( 'fs' );
|
||||
const pwHandler = require( '../credentials/pwdmanager.js' );
|
||||
|
||||
class POSTHandler {
|
||||
constructor () {
|
||||
@@ -153,6 +154,18 @@ class POSTHandler {
|
||||
console.error( error );
|
||||
reject( { 'code': 500, 'message': 'ERR_DB' } );
|
||||
} );
|
||||
} else if ( call === 'resetPW' ) {
|
||||
pwHandler.resetPassword( data.email ).then( () => {
|
||||
resolve( 'ok' );
|
||||
} ).catch( error => {
|
||||
if ( error.code ) {
|
||||
reject( error );
|
||||
} else {
|
||||
reject( { 'code': 500, 'message': error } );
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
reject( { 'code': 404, 'message': 'Route not found' } );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user