mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2025-10-03 01:39:31 +02:00
Sign in parents by default
This commit is contained in:
parent
9dc797a96c
commit
2acee613f6
4 changed files with 9 additions and 5 deletions
|
@ -52,7 +52,8 @@ export const addChildDevice = async ({ database, websocket, request }: {
|
|||
deviceAuthToken,
|
||||
deviceName: request.deviceName,
|
||||
newDeviceInfo: request.childDevice,
|
||||
userId: ''
|
||||
userId: '',
|
||||
isUserKeptSignedIn: false
|
||||
}), { transaction })
|
||||
|
||||
await database.family.update({
|
||||
|
|
|
@ -19,13 +19,14 @@ import { NewDeviceInfo } from '../../api/schema'
|
|||
import { DeviceAttributes } from '../../database/device'
|
||||
import { generateVersionId } from '../../util/token'
|
||||
|
||||
export const prepareDeviceEntry = ({ familyId, userId, deviceAuthToken, deviceId, deviceName, newDeviceInfo }: {
|
||||
export const prepareDeviceEntry = ({ familyId, userId, deviceAuthToken, deviceId, deviceName, newDeviceInfo, isUserKeptSignedIn }: {
|
||||
familyId: string
|
||||
userId: string
|
||||
deviceAuthToken: string
|
||||
deviceId: string
|
||||
deviceName: string
|
||||
newDeviceInfo: NewDeviceInfo
|
||||
isUserKeptSignedIn: boolean
|
||||
}): DeviceAttributes => ({
|
||||
familyId,
|
||||
deviceId,
|
||||
|
@ -52,7 +53,7 @@ export const prepareDeviceEntry = ({ familyId, userId, deviceAuthToken, deviceId
|
|||
lastConnectivity: '0',
|
||||
notSeenForLongTime: false,
|
||||
didDeviceReportUninstall: false,
|
||||
isUserKeptSignedIn: false,
|
||||
isUserKeptSignedIn,
|
||||
showDeviceConnected: false,
|
||||
defaultUserId: '',
|
||||
defaultUserTimeout: 0,
|
||||
|
|
|
@ -94,7 +94,8 @@ export const createFamily = async ({ database, mailAuthToken, firstParentDevice,
|
|||
deviceName,
|
||||
newDeviceInfo: firstParentDevice,
|
||||
userId,
|
||||
deviceAuthToken
|
||||
deviceAuthToken,
|
||||
isUserKeptSignedIn: true
|
||||
}), { transaction })
|
||||
|
||||
return {
|
||||
|
|
|
@ -61,7 +61,8 @@ export const signInIntoFamily = async ({ database, mailAuthToken, newDeviceInfo,
|
|||
userId: userEntry.userId,
|
||||
deviceName,
|
||||
deviceAuthToken,
|
||||
newDeviceInfo
|
||||
newDeviceInfo,
|
||||
isUserKeptSignedIn: true
|
||||
}), { transaction })
|
||||
|
||||
// notify about changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue