MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / signup

Function signup

hackernews/backend-nodejs/src/resolvers/Mutation.js:20–32  ·  view source on GitHub ↗
(parent, args, context, info)

Source from the content-addressed store, hash-verified

18}
19
20async function signup(parent, args, context, info) {
21 const password = await bcrypt.hash(args.password, 10);
22 const user = await context.prisma.user.create({
23 data: { ...args, password }
24 });
25
26 const token = jwt.sign({ userId: user.id }, APP_SECRET);
27
28 return {
29 token,
30 user
31 };
32}
33
34async function login(parent, args, context, info) {
35 const user = await context.prisma.user.findUnique({

Callers

nothing calls this directly

Calls 1

createMethod · 0.80

Tested by

no test coverage detected