MCPcopy Create free account
hub / github.com/emwalker/digraph / onCompleted

Function onCompleted

client/src/server/auth/withGithub.ts:64–78  ·  view source on GitHub ↗
(payload: Payload)

Source from the content-addressed store, hash-verified

62 }
63
64 const onCompleted = (payload: Payload) => {
65 if (!payload.createGithubSession) {
66 console.log('createGithubSession field missing from response:', payload)
67 done(null, null)
68 return
69 }
70
71 const { createGithubSession } = payload
72 const userEdge = createGithubSession?.userEdge
73 const sessionEdge = createGithubSession?.sessionEdge
74 console.log('User fetched from api, saving to session', userEdge, sessionEdge)
75 const id = userEdge && userEdge.node && userEdge.node.id
76 const sessionId = sessionEdge?.node?.id
77 done(null, { id, sessionId })
78 }
79
80 const onError = (error: Error) => {
81 console.log('Something happened:', error)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected