mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
solve infinite recursion and promise returning true
This commit is contained in:
@@ -61,7 +61,7 @@ export class BackupService {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async hasThisBackup(target: BackupTarget, id: string): Promise<boolean> {
|
hasThisBackup(target: BackupTarget, id: string): boolean {
|
||||||
return (
|
return (
|
||||||
target.startOs[id] &&
|
target.startOs[id] &&
|
||||||
this.emver.compare(target.startOs[id].version, '0.3.6') !== -1
|
this.emver.compare(target.startOs[id].version, '0.3.6') !== -1
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export class BackupServerSelectModal {
|
|||||||
|
|
||||||
if (role === 'confirm') {
|
if (role === 'confirm') {
|
||||||
try {
|
try {
|
||||||
|
// @TODO Alex if invalid password, we should tell the user "Invalid password" and halt execution of this function. The modal should remain so the user can try again. Correct password is asdfasdf
|
||||||
argon2.verify(server.passwordHash!, data)
|
argon2.verify(server.passwordHash!, data)
|
||||||
await this.restoreFromBackup(serverId, data)
|
await this.restoreFromBackup(serverId, data)
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export class ServerBackupPage {
|
|||||||
component: BackupSelectPage,
|
component: BackupSelectPage,
|
||||||
})
|
})
|
||||||
|
|
||||||
modal.onWillDismiss().then(res => {
|
modal.onDidDismiss().then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.serviceIds = res.data
|
this.serviceIds = res.data
|
||||||
this.presentModalPassword(target)
|
this.presentModalPassword(target)
|
||||||
@@ -90,6 +90,7 @@ export class ServerBackupPage {
|
|||||||
.subscribe(async (password: string) => {
|
.subscribe(async (password: string) => {
|
||||||
const { passwordHash, id } = await getServerInfo(this.patch)
|
const { passwordHash, id } = await getServerInfo(this.patch)
|
||||||
|
|
||||||
|
// @TODO Alex if invalid password, we should tell the user "Invalid password" and halt execution of this function. The modal should remain so the user can try again. Correct password is asdfasdf
|
||||||
// confirm password matches current master password
|
// confirm password matches current master password
|
||||||
argon2.verify(passwordHash, password)
|
argon2.verify(passwordHash, password)
|
||||||
|
|
||||||
@@ -103,7 +104,7 @@ export class ServerBackupPage {
|
|||||||
} catch {
|
} catch {
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => this.presentModalOldPassword(target, password),
|
() => this.presentModalOldPassword(target, password),
|
||||||
500,
|
250,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -134,8 +135,8 @@ export class ServerBackupPage {
|
|||||||
})
|
})
|
||||||
.pipe(take(1))
|
.pipe(take(1))
|
||||||
.subscribe(async (oldPassword: string) => {
|
.subscribe(async (oldPassword: string) => {
|
||||||
const passwordHash = target.entry.startOs[id].passwordHash!
|
// @TODO Alex if invalid password, we should tell the user "Invalid password" and halt execution of this function. The modal should remain so the user can try again. Correct password is asdfasdf
|
||||||
argon2.verify(passwordHash, oldPassword)
|
argon2.verify(target.entry.startOs[id].passwordHash!, oldPassword)
|
||||||
await this.createBackup(target, password, oldPassword)
|
await this.createBackup(target, password, oldPassword)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user