Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-04-23 21:49:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dbb4c19bd3c7a526ad878f73bb367ca32664b52f
dbb4c19b
1 parent
ddf82e2f
update requestEmailSecret
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
back/src/api/User/requestEmailSecret/requestEmailSecret.graphql
back/src/api/User/requestEmailSecret/requestEmailSecret.js
back/src/api/User/requestEmailSecret/requestEmailSecret.graphql
0 → 100644
View file @
dbb4c19
type Mutation {
requestEmailSecret(email: String!): Boolean!
}
back/src/api/User/requestEmailSecret/requestEmailSecret.js
0 → 100644
View file @
dbb4c19
import
{
prisma
,
generateSecret
,
sendSecretMail
}
from
"../../../utils"
;
export
default
{
Mutation
:
{
requestEmailSecret
:
async
(
_
,
args
)
=>
{
const
{
email
}
=
args
;
const
emailSecret
=
generateSecret
();
try
{
await
sendSecretMail
(
email
,
emailSecret
);
await
prisma
.
user
.
update
({
where
:
{
email
,
},
data
:
{
emailSecret
,
},
});
return
true
;
}
catch
(
error
)
{
console
.
log
(
error
);
return
false
;
}
},
},
};
Please
register
or
login
to post a comment