MCPcopy
hub / github.com/epicweb-dev/epic-stack / login

Function login

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

Source from the content-addressed store, hash-verified

71}
72
73export async function login({
74 username,
75 password,
76}: {
77 username: User['username']
78 password: string
79}) {
80 const user = await verifyUserPassword({ username }, password)
81 if (!user) return null
82 const session = await prisma.session.create({
83 select: { id: true, expirationDate: true, userId: true },
84 data: {
85 expirationDate: getSessionExpirationDate(),
86 userId: user.id,
87 },
88 })
89 return session
90}
91
92export async function resetUserPassword({
93 username,

Callers 5

actionFunction · 0.90
notes.test.tsFile · 0.85
2fa.test.tsFile · 0.85

Calls 2

verifyUserPasswordFunction · 0.85
getSessionExpirationDateFunction · 0.85

Tested by

no test coverage detected