File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as objectsMutations from '../helpers/objectsMutations';
5
5
import { OBJECT } from './defaultGraphQLTypes' ;
6
6
import { getUserFromSessionToken } from './usersQueries' ;
7
7
import { transformTypes } from '../transformers/mutation' ;
8
+ import Parse from 'parse/node' ;
8
9
9
10
const usersRouter = new UsersRouter ( ) ;
10
11
@@ -284,18 +285,19 @@ const load = parseGraphQLSchema => {
284
285
} ,
285
286
} ,
286
287
mutateAndGetPayload : async ( { username, password, token } , context ) => {
287
- const { config, auth, info } = context ;
288
- await usersRouter . handleResetPassword ( {
289
- body : {
290
- username,
291
- password,
292
- token,
293
- } ,
294
- config,
295
- auth,
296
- info,
297
- } ) ;
288
+ const { config } = context ;
289
+ if ( ! username ) {
290
+ throw new Parse . Error ( Parse . Error . USERNAME_MISSING , 'you must provide a username' ) ;
291
+ }
292
+ if ( ! password ) {
293
+ throw new Parse . Error ( Parse . Error . PASSWORD_MISSING , 'you must provide a password' ) ;
294
+ }
295
+ if ( ! token ) {
296
+ throw new Parse . Error ( Parse . Error . OTHER_CAUSE , 'you must provide a token' ) ;
297
+ }
298
298
299
+ const userController = config . userController ;
300
+ await userController . updatePassword ( username , token , password ) ;
299
301
return { ok : true } ;
300
302
} ,
301
303
} ) ;
You can’t perform that action at this time.
0 commit comments