User session fixes

This commit is contained in:
Magnus Åhall 2024-01-05 21:14:55 +01:00
parent 52fba2289e
commit afa113b8b7
5 changed files with 11 additions and 42 deletions

View file

@ -25,7 +25,7 @@ class App extends Component {
this.startNode = null
//this.setStartNode()
this.setStartNode()
}//}}}
render() {//{{{
let app_el = document.getElementById('app')

View file

@ -1,10 +1,10 @@
export class Session {
constructor(app) {
constructor(app) {//{{{
this.app = app
this.UUID = ''
this.initialized = false
this.UserID = 0
}
}//}}}
initialize() {//{{{
// Retrieving the stored session UUID, if any.
@ -29,7 +29,7 @@ export class Session {
if (res.Error === undefined) {
// Session exists on server.
// Not necessarily authenticated.
this.UserID = res.UserID // could be 0
this.UserID = res.Session.UserID // could be 0
this.initialized = true
this.app.forceUpdate()
} else {
@ -58,7 +58,7 @@ export class Session {
})
.then(res => {
if (res.Authenticated) {
this.UserID = res.Session.UserID
this.UserID = res.UserID
this.app.forceUpdate()
} else {
this.app.login.current.authentication_failed.value = true