Commit Graph

21 Commits

Author SHA1 Message Date
Javi Martín
305bf9161c Enable forgery protection in ActionController
We were manually adding forgery protection to all our controllers, but
in Rails 5.2 there's an option (enabled by default for new applications)
which adds this protection to all controllers.
2020-10-15 14:57:42 +02:00
Javi Martín
58157beb01 Add CSRF protection to management controllers 2019-11-13 01:33:56 +01:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
ae6fab9f5e Inherit from builder instead of monkey patching it
We were monkey-patching FoundationRailsHelper::Formbuilder, which made
form customization difficult. We can inherit from it, which is the
standard way of extending what an existing class does, and make our form
the default one.
2019-10-05 16:01:58 +02:00
Javi Martín
9fe8c47528 Apply Rails/SafeNavigation rubocop rule 2019-09-10 21:43:39 +02:00
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00
Senén Rodero Rodríguez
8c2f1b894d Add controller concern to initialize Globalize fallbacks
Ensure to initialize all requests including this concern into all
application base controllers.
2019-06-27 09:20:24 +02:00
Javi Martín
286e0ca878 Handle AccessDenied in management sessions
We were raising a `CanCan::AcessDenied` and were getting a 500 Internal
Server Error.

I've chosen to do the same thing we do in the ApplicationController.
There are other options to handle this request, like redirecting to the
login page or returning a 401 Unauthorized HTTP status.
2019-04-25 20:36:50 +02:00
taitus
9b6b57a24c Remove all white spaces 2017-09-06 14:12:32 +02:00
Bertocq
21c6d1c4dd Cleanup Lint/AssignmentInCondition rubocop issues on code and remove it from ruboco_todo list 2017-06-19 10:45:18 +02:00
rgarcia
bb3c4c6399 adds consistency to ruby code style
Keep a blank line before and after private
Keep a blank line before and after protected
Remove extra empty line at class body end
Remove extra blank line
Add final newline
Use 2 (not 3) spaces for indentation
Use 2 (not 4) spaces for indentation
Remove space before comma
Add space after comma
Remove trailing whitespaces
Remove unnecessary spacing
Use snake_case for variable names
Do not use then for multi-line if
Remove unused block argument - i
Use the new Ruby 1.9 hash syntax
Remove unused assignment to variable
Indent when as deep as case
Align attributes
Align end with def
2016-11-15 11:18:43 +01:00
Juanjo Bazán
d1e50d70d6 managers can login to /management 2016-05-10 19:10:02 +02:00
Juanjo Bazán
2eabab657a allows admin to sign in into management 2016-04-27 17:26:19 +02:00
Juanjo Bazán
510d85cf97 unifies session key 2015-10-23 14:05:23 +02:00
Juanjo Bazán
f1bc7af462 makes manager logout to remove session user data 2015-10-23 13:37:19 +02:00
Juanjo Bazán
89cc26c261 adds managers login via ManagerAuthenticators 2015-10-15 15:57:53 +02:00
rgarcia
b2bd3d455b differentiates between manager session and managed user session 2015-10-12 14:05:51 +02:00
rgarcia
e66572b8ba adds translations 2015-10-11 17:14:29 +02:00
rgarcia
54a7597168 destroys manager and managed_user session 2015-10-11 16:57:09 +02:00
rgarcia
3fe8b6e603 adds consistency to spacing 2015-10-11 16:50:27 +02:00
Juanjo Bazán
742ea1bd2e adds management/sessions controller 2015-10-01 17:53:15 +02:00