chairemobilite / transition

Transition is a modern new approach to transit planning. It's a web application to model, simulate and plan public transit and alternative transportation.
http://transition.city
MIT License
20 stars 13 forks source link

Add bearer strategy with token #904

Closed tahini closed 2 months ago

tahini commented 2 months ago

This cleanly adds the authentication method with token. It adds a user in the auth model with the token as username (this avoids adding a new field to the user table). Relogging with the same token in the URL will cause the user to log back in with the same user data.

kaligrafy commented 2 months ago

I will let @greenscientist review this one

tahini commented 2 months ago

We need to document a bit more the configuraiton format for the "regex" If your example, you use: tokenFormat: /^[\d]{10}$/gi But the regex part is really just "^[\d]{10}$", the rest is specific to the regex engine used and could have quite different meanings. (I'm not fully sure we want people to be able to use the g to be able to match multiple lines of content.

I just realized the configs are documented in chaire-lib-common, so it's been added there.