MCPcopy
hub / github.com/CapSoftware/Cap / createOrUpdateEmailUser

Function createOrUpdateEmailUser

apps/web/app/api/mobile/[...route]/route.ts:145–162  ·  view source on GitHub ↗
(email: string)

Source from the content-addressed store, hash-verified

143};
144
145const createOrUpdateEmailUser = async (email: string) => {
146 const { createUser, getUserByEmail, updateUser } = getEmailAuthAdapter();
147 const existingUser = await getUserByEmail(email);
148
149 if (existingUser) {
150 return updateUser({
151 id: existingUser.id,
152 emailVerified: new Date(),
153 });
154 }
155
156 return createUser({
157 email,
158 emailVerified: new Date(),
159 image: null,
160 name: null,
161 });
162};
163
164const parseBearerToken = (authorization: string | undefined) => {
165 if (!authorization) return null;

Callers 1

route.tsFile · 0.85

Calls 4

getEmailAuthAdapterFunction · 0.85
getUserByEmailFunction · 0.85
updateUserFunction · 0.85
createUserFunction · 0.85

Tested by

no test coverage detected