camptocamp / GeoMapFish

6 stars 1 forks source link

Make login page responsive #57

Open rbovard opened 2 years ago

rbovard commented 2 years ago

Who requested this new feature?

City of Vevey

Is your feature request related to a problem?

No

Describe the solution you'd like

Make login page responsive https://geomapfish-demo-2-6.camptocamp.com/oauth/login

Additional information or points to watch out for

EDIT 27.10.2022: Requires technical functionality "pluggable authentication"

Current situtation image The admin panel login is based on the same template https://geomapfish-demo-2-6.camptocamp.com/admin/

maltaesousa commented 2 years ago

I've just got this problem. One way to solve this, if you don't want to wait for its implementation, is to override the default template with the help of the "Overriding asset API" from pyramid: https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/assets.html#overriding-assets-section

In the __init__.py of your geoportal, ie: geoportal/sitn_geoportal/__init__.py in the main method, before adding the routes:

    config.override_asset(
        to_override='c2cgeoportal_geoportal:templates/login.html',
        override_with='sitn_geoportal:templates/login.html')

Be sure to replace sitn_geoportal by your package name.

Then you can copy-paste the original login.html and make it responsive, or take mine and put it in your templates directory (mine is: geoportal/sitn_geoportal/templates/login.html):

login.html ```html ${_('Login to Geoportal Application')}
% if two_fa:
% endif
```

This works great for /login.html route but I've not tested the oauth2 route.

rbovard commented 2 years ago

Thanks a lot @maltaesousa, I'll take a look!

For the OAuth2 route, you can simply test with https://sitn.ne.ch/oauth/login

rbovard commented 2 years ago

@maltaesousa Do you know if there is a way to add the link "Reset password" in this login form?

maltaesousa commented 2 years ago

Yes there's a way: first you'll need to create a second template with a custom pyramid route and handle the password reset stuff. We have something similar in different views in our geoportal, for instance:

Maybe it's better to wait for funding calls to see if this issue gets funded. I'm wondering if we will be able to reuse the webcomponent done for the front here because everything is already done in the gmf-auth-panel.

rbovard commented 2 years ago

Thanks for your answer, we'll think about that webcomponent migration issue.