@@ -89,6 +89,12 @@ export default (langName, lang) => new Elysia({ prefix: "/panel" })
Auth.editUser(session.email, newName, newEmail)
+ Auth.removeSession(session.id)
+
+ const newSession = await Auth.createSession(newEmail)
+ cookie.session.value = newSession.token
set.headers['content-type'] = 'text/html; charset=utf8'
return redirect(`/${langName === "sk" ? `` : `${langName}/`}panel`)
})
@@ -135,6 +135,8 @@ export default class Auth {
where email = ?;
`).run(newName, newEmail, email)
+ Meteostanice.editOwnerOnOwned(email, newEmail)
return result
}
@@ -115,6 +115,14 @@ export default class Meteostanice {
`).run(newName, newDescription, newOwner, id)
+ static editOwnerOnOwned(owner, newOwner) {
+ meteostaniceDB.prepare(`
+ update list
+ owner = ?
+ where owner = ?;
+ `).run(newOwner, owner)
+ }
static remove(id) {
meteostaniceDB.prepare(`
DELETE