feat: move /first_install to vue component (#3485)

This commit is contained in:
dni ⚡
2025-11-10 11:17:29 +01:00
committed by GitHub
parent 8755984bd8
commit f8c58aef0e
13 changed files with 205 additions and 166 deletions
+37
View File
@@ -0,0 +1,37 @@
window.PageFirstInstall = {
template: '#page-first-install',
mixins: [window.windowMixin],
data() {
return {
loginData: {
isPwd: true,
isPwdRepeat: true,
username: '',
password: '',
passwordRepeat: ''
}
}
},
computed: {
checkPasswordsMatch() {
return this.loginData.password !== this.loginData.passwordRepeat
}
},
methods: {
async setPassword() {
try {
await LNbits.api.request('PUT', '/api/v1/auth/first_install', null, {
username: this.loginData.username,
password: this.loginData.password,
password_repeat: this.loginData.passwordRepeat
})
window.location.href = '/admin'
} catch (e) {
LNbits.utils.notifyApiError(e)
}
}
},
created() {
document.title = 'First Install - LNbits'
}
}