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 22:42:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a5e476f49a32d5c67ee8dedd23042950c9d66524
a5e476f4
1 parent
c168683b
rename files
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
33 deletions
back/src/api/User/confirmEmailSecret/confirmEmailSecret.graphql
back/src/api/User/confirmEmailSecret/confirmEmailSecret.js
back/src/api/User/confirmEmailSecret/confirmEmailSecret.graphql
deleted
100644 → 0
View file @
c168683
type Mutation {
confirmEmailSecret(secret: String!, email: String!): String!
}
back/src/api/User/confirmEmailSecret/confirmEmailSecret.js
deleted
100644 → 0
View file @
c168683
import
{
prisma
,
generateToken
}
from
"../../../utils"
;
export
default
{
Mutation
:
{
confirmEmailSecret
:
async
(
_
,
args
)
=>
{
const
{
secret
,
email
}
=
args
;
const
user
=
await
prisma
.
user
.
findOne
({
where
:
{
email
,
},
});
if
(
user
.
emailSecret
!==
secret
)
{
throw
new
Error
(
"not vaild secret value!, input another value or resend email"
);
}
else
{
// TODO: Update emailSecret in prisma
await
prisma
.
user
.
update
({
where
:
{
email
,
},
data
:
{
emailSecret
:
""
,
},
});
return
generateToken
(
user
.
id
);
}
},
},
};
Please
register
or
login
to post a comment