Electron Login / Register etc Electron Login / Register etc mongodb mongodb

Electron Login / Register etc


If all you need is a login and your server already manages the database I would keep this logic on the server. This is also something the answer to your previous question states.

  • Your client sends a POST request containing the username, password over HTTPS (SSL encryption), this can happen in the renderer process.
  • Your Server checks if the password and user are valid.
  • Server returns your client if the authentification was valid, via token.
    • Either the main process (Electron-NodeJs) persists the token (File)
    • Or the Render process (Electron-Chromium) persists the token (Web Storage)

This is the most simple example which is neglecting advanced security concerns, if you want to make it more secure you definitely should look for general advise about web security like crypto-pbkdf2 and how to handle the tokens. But this is not electron specific.