MCPcopy Index your code
hub / github.com/epicweb-dev/epic-stack / signup

Function signup

app/utils/auth.server.ts:112–146  ·  view source on GitHub ↗
({
	email,
	username,
	password,
	name,
}: {
	email: User['email']
	username: User['username']
	name: User['name']
	password: string
})

Source from the content-addressed store, hash-verified

110}
111
112export async function signup({
113 email,
114 username,
115 password,
116 name,
117}: {
118 email: User['email']
119 username: User['username']
120 name: User['name']
121 password: string
122}) {
123 const hashedPassword = await getPasswordHash(password)
124
125 const session = await prisma.session.create({
126 data: {
127 expirationDate: getSessionExpirationDate(),
128 user: {
129 create: {
130 email: email.toLowerCase(),
131 username: username.toLowerCase(),
132 name,
133 roles: { connect: { name: 'user' } },
134 password: {
135 create: {
136 hash: hashedPassword,
137 },
138 },
139 },
140 },
141 },
142 select: { id: true, expirationDate: true },
143 })
144
145 return session
146}
147
148export async function signupWithConnection({
149 email,

Callers 1

actionFunction · 0.90

Calls 2

getPasswordHashFunction · 0.85
getSessionExpirationDateFunction · 0.85

Tested by

no test coverage detected