mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Save the locale during mail login processes
This commit is contained in:
@@ -19,13 +19,18 @@ import { Unauthorized } from 'http-errors'
|
||||
import { Database, Transaction } from '../../database'
|
||||
import { generateAuthToken } from '../../util/token'
|
||||
|
||||
export const createAuthTokenByMailAddress = async ({ mail, database, transaction }: { mail: string, database: Database, transaction: Transaction }) => {
|
||||
export const createAuthTokenByMailAddress = async ({
|
||||
mail, database, transaction, locale
|
||||
}: {
|
||||
mail: string, database: Database, transaction: Transaction, locale: string
|
||||
}) => {
|
||||
const token = generateAuthToken()
|
||||
|
||||
await database.authtoken.create({
|
||||
token,
|
||||
mail,
|
||||
createdAt: Date.now().toString()
|
||||
createdAt: Date.now().toString(),
|
||||
locale
|
||||
}, { transaction })
|
||||
|
||||
return token
|
||||
|
||||
Reference in New Issue
Block a user