title: How to do login authentication using java rest api and routing in electron js
body: <p>I am beginner working with electron js I have created my first app in electron js and I am trying to do login authentication using java rest API since I am not knowing how to do that I have done completed hard coded authentication.When Login gets success how to do routing to new screen such as dashboard</p>
  <pre class="lang-js prettyprint-override"><code> const { app, BrowserWindow } = require('electron');
              const path = require('path');
              
              const createWindow = () =&gt; {
                const mainWindow = new BrowserWindow({
                  width: 800,
                  height: 600,
                });
                mainWindow.loadFile(path.join(__dirname, 'index.html'));
              };
          
          app.on('ready', createWindow);
          
          app.on('window-all-closed', () =&gt; {
            if (process.platform !== 'darwin') {
              app.quit();
            }
          });
          
          app.on('activate', () =&gt; {
            if (BrowserWindow.getAllWindows().length === 0) {
              createWindow();
            }
          });
  </code></pre>
  <pre class="lang-html prettyprint-override"><code> &lt;!DOCTYPE html&gt;
              &lt;html&gt;
                &lt;head&gt;
                  &lt;meta charset=&quot;UTF-8&quot;&gt;
                  &lt;title&gt;Hello World!&lt;/title&gt;
                  &lt;link rel=&quot;stylesheet&quot; href=&quot;index.css&quot;&gt;
                &lt;/head&gt;
                &lt;body&gt;
                  &lt;form&gt;
                    &lt;fieldset&gt;
                     &lt;legend&gt;Login:&lt;/legend&gt;
                     &lt;label for=&quot;username&quot;&gt;UserName&lt;/label&gt;
                     &lt;input type=&quot;text&quot; id=&quot;uname&quot; name=&quot;fname&quot;&gt;&lt;br&gt;&lt;br&gt;
                     &lt;label for=&quot;password&quot;&gt;Password:&lt;/label&gt;
                     &lt;input type=&quot;password&quot; id=&quot;pwd&quot; name=&quot;lname&quot;&gt;&lt;br&gt;&lt;br&gt;      
                     &lt;input type=&quot;submit&quot; value=&quot;Login&quot; id=&quot;sbtn&quot;&gt;
                    &lt;/fieldset&gt;
                   &lt;/form&gt;
                &lt;/body&gt;
                &lt;script&gt;
                  document.querySelector('#sbtn').addEventListener('click', () =&gt; {
                  let userName=document.getElementById(&quot;uname&quot;).value;
                  let pwd=document.getElementById(&quot;pwd&quot;).value;
                  if(userName==&quot;abc&quot; &amp;&amp; pwd==&quot;123&quot;){
                    alert(&quot;Login sucess&quot;);
                  }else{
                    alert(&quot;Failed to login&quot;)
                  }
              })
                &lt;/script&gt;
              &lt;/html&gt;
  </code></pre>