linagora / esn

OpenPaaS web & API server
4 stars 0 forks source link

Developer Experience: login screen #12

Closed MichaelBailly closed 4 years ago

MichaelBailly commented 4 years ago
chamerling commented 4 years ago

We discussed about having a new application for this implemented in VueJS with a single view showing a login form which is displayed when the user is not logged in (this is only when SSO OIDC is not available).

This means that we have to tweak webpack-dev-server or webpack to show this VueJS-based page. I do not know how to handle this currently:

  1. Do we open a new dev-server on a new port where we are redirected when not logged in, then login and redirect to the original SPA with some parameter to be able to share the cookie.
  2. Or do we embed the Login SPA (which may bring new dependencies and so conflicts with old angularJS ones)

A simpler solution will be to have a simple page like before (angularJS one, but lighter), which is included by webpack only in dev mode.

Another solution I used is to use process.env to set login/password and do a loginAPI.login before session.bootstrap so that we get back the cookie and do not have to do anything else: You are always connected. Cons: Having to restart webpack when you want to test with another account.

@MichaelBailly what do you suggest Vue, old AngularJS, process.env (this one can live with the others, it shorcuts everything)

MichaelBailly commented 4 years ago

Here https://github.com/OpenPaaS-Suite/esn-frontend-account/blob/main/webpack.commons.js#L61-L62 you change to

contentBase: [path.join(__dirname, 'dist'), path.join(__dirname, 'node_modules/the-login-app/dist')],
contentBasePublicPath: [BASE_HREF, '/login']

and that should work

chamerling commented 4 years ago

OMG this is so easy :p