client/webserver/site/src/js/login.js
/* login submits the sign-in form and parses the result. */
login submits the sign-in form and parses the result.
login submits the sign - in form and parses the result .
async login (e) {
    const page = this.page
    Doc.hide(page.errMsg)
    const pw = page.pw.value
    page.pw.value = ''
    if (pw === '') {
      page.errMsg.textContent = 'password cannot be empty'
      Doc.show(page.errMsg)
      return
    }
    app.loading(page.loginForm)
    var res = await postJSON('/api/login', { pass: pw })
    app.loaded()
    if (!app.checkResponse(res)) {
      page.errMsg.textContent = res.msg
      Doc.show(page.errMsg)
      return
    }
    if (res.notes) {
      res.notes.reverse()
    }
    app.setNotes(res.notes || [])
    await app.fetchUser()
    app.loadPage('markets')
  }
async login ( e ) { const page = this . page Doc . hide ( page . errMsg ) const pw = page . pw . value page . pw . value = '' if ( pw === '' ) { page . errMsg . textContent = 'password cannot be empty' Doc . show ( page . errMsg ) return } app . loading ( page . loginForm ) var res = await postJSON ( '/api/login' , { pass : pw } ) app . loaded ( ) if ( ! app . checkResponse ( res ) ) { page . errMsg . textContent = res . msg Doc . show ( page . errMsg ) return } if ( res . notes ) { res . notes . reverse ( ) } app . setNotes ( res . notes || [ ] ) await app . fetchUser ( ) app . loadPage ( 'markets' ) }
login submits the sign-in form and parses the result.
login submits the sign - in form and parses the result .