mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2025-10-03 09:49:32 +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,
|
deviceAuthToken,
|
||||||
deviceName: request.deviceName,
|
deviceName: request.deviceName,
|
||||||
newDeviceInfo: request.childDevice,
|
newDeviceInfo: request.childDevice,
|
||||||
userId: ''
|
userId: '',
|
||||||
|
isUserKeptSignedIn: false
|
||||||
}), { transaction })
|
}), { transaction })
|
||||||
|
|
||||||
await database.family.update({
|
await database.family.update({
|
||||||
|
|
|
@ -19,13 +19,14 @@ import { NewDeviceInfo } from '../../api/schema'
|
||||||
import { DeviceAttributes } from '../../database/device'
|
import { DeviceAttributes } from '../../database/device'
|
||||||
import { generateVersionId } from '../../util/token'
|
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
|
familyId: string
|
||||||
userId: string
|
userId: string
|
||||||
deviceAuthToken: string
|
deviceAuthToken: string
|
||||||
deviceId: string
|
deviceId: string
|
||||||
deviceName: string
|
deviceName: string
|
||||||
newDeviceInfo: NewDeviceInfo
|
newDeviceInfo: NewDeviceInfo
|
||||||
|
isUserKeptSignedIn: boolean
|
||||||
}): DeviceAttributes => ({
|
}): DeviceAttributes => ({
|
||||||
familyId,
|
familyId,
|
||||||
deviceId,
|
deviceId,
|
||||||
|
@ -52,7 +53,7 @@ export const prepareDeviceEntry = ({ familyId, userId, deviceAuthToken, deviceId
|
||||||
lastConnectivity: '0',
|
lastConnectivity: '0',
|
||||||
notSeenForLongTime: false,
|
notSeenForLongTime: false,
|
||||||
didDeviceReportUninstall: false,
|
didDeviceReportUninstall: false,
|
||||||
isUserKeptSignedIn: false,
|
isUserKeptSignedIn,
|
||||||
showDeviceConnected: false,
|
showDeviceConnected: false,
|
||||||
defaultUserId: '',
|
defaultUserId: '',
|
||||||
defaultUserTimeout: 0,
|
defaultUserTimeout: 0,
|
||||||
|
|
|
@ -94,7 +94,8 @@ export const createFamily = async ({ database, mailAuthToken, firstParentDevice,
|
||||||
deviceName,
|
deviceName,
|
||||||
newDeviceInfo: firstParentDevice,
|
newDeviceInfo: firstParentDevice,
|
||||||
userId,
|
userId,
|
||||||
deviceAuthToken
|
deviceAuthToken,
|
||||||
|
isUserKeptSignedIn: true
|
||||||
}), { transaction })
|
}), { transaction })
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -61,7 +61,8 @@ export const signInIntoFamily = async ({ database, mailAuthToken, newDeviceInfo,
|
||||||
userId: userEntry.userId,
|
userId: userEntry.userId,
|
||||||
deviceName,
|
deviceName,
|
||||||
deviceAuthToken,
|
deviceAuthToken,
|
||||||
newDeviceInfo
|
newDeviceInfo,
|
||||||
|
isUserKeptSignedIn: true
|
||||||
}), { transaction })
|
}), { transaction })
|
||||||
|
|
||||||
// notify about changes
|
// notify about changes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue