Commit graph

117 commits

Author SHA1 Message Date
Anton Khorev
9254f0c2be Remove pd checkbox from signup page 2025-01-18 19:17:03 +03:00
Anton Khorev
8db2ff289f Use resourceful route for user status 2025-01-16 02:17:06 +03:00
Anton Khorev
606b5c1b6a Use resourceful routes for terms view/accept/decline 2025-01-08 22:19:35 +03:00
Anton Khorev
127e376bf0 Move code that runs after user save from save_new_user to create method 2024-12-29 04:43:18 +03:00
Anton Khorev
507c395f51 Move admin users list to its own controller 2024-12-10 18:38:30 +03:00
Tom Hughes
fe96c0a524 Replace creation_ip with creation_address 2024-09-15 19:38:21 +01:00
Anton Khorev
e2a6701696 Merge branch 'pull/5182' 2024-09-12 09:43:56 +03:00
Tom Hughes
e22d19f004 Limit the number of users counted for users#index
This view uses cursor based pagination but then undermines
that by counting the total number of users so limit the effect
of that but counting a maximum of ten pages of users.
2024-09-11 18:28:35 +01:00
Tom Hughes
336ad6db03 Add creation_address column to users
This is a properly typed and indexed column that is intended
to replace creation_ip to allow fast queries.
2024-09-10 19:16:03 +01:00
Tom Hughes
edddaab122 Use turbo for pagination 2024-08-20 14:44:10 +01:00
Anton Khorev
4e01f6830a Don't call check_signup_allowed inside save_new_user 2024-07-06 18:51:54 +03:00
Milan Cvetkovic
15623aa35a Social sign-in: avoid re-authorization in users_controller#create
It does not add any additional guards against malicious users:

Malicious user may attempt to invoke `POST /users/new` with bogus
values for `auth_provider` and `auth_uid` resulting
with a new account to which user would have a way to login, other than
sending a password reset request.

In some cases, re-authorization would introduce additional
"Please login to your social account", or "Are you sure you want to be logged in"
popup triggered by identity provider.

This PR removes the re-authorization request from `POST /users/new` in authorization flow.
2024-05-30 05:43:45 +00:00
Milan Cvetkovic
22bceff40b Add proper referrer for authorization scenario
Fixes the following:
- `users_controller#new` loses referer in authorization scenario, when it was invoked after social signup succeded
- the second invocation of `auth_success`, triggered by re-authorization initiated from `users_controller#create`
  does not have referrer field set
- as a result, the final welcome screen does not offer final authorization, and drops into ID instead

Introduced by #4758.
2024-05-27 13:31:20 +00:00
Tom Hughes
20bdbb05c3 Switch to using rails builtin content security policy support 2024-05-22 16:38:59 +01:00
Andy Allan
8a5c9a8052
Merge pull request #4758 from tomhughes/login-referer
Stop using the session to persist the referer during login
2024-05-22 12:09:31 +01:00
Tom Hughes
ebb1fba41d Really remove login.live.com from CSP allow list 2024-05-10 17:55:11 +01:00
Milan Cvetkovic
b07c758345 Fix CSP failures for Microsoft social sign-in
Replace login.live.com with login.microsoftonline.com in CSP allow list.

The URL changed with the move from using the omniauth-windowslive plugin
to the omniauth-microsoft_graph plugin but wasn't noticed until now.
2024-05-10 17:40:14 +01:00
Tom Hughes
74cc88fce4 Stop using the session to persist the referer during login 2024-05-06 10:55:07 +01:00
Tom Hughes
1874e5b1a2 Improve flash message handling in users#new
Only show the duplicate email message if we actually have errors
logged against the email field, and then show it as a warning.

In all other cases we show the generic informational hint about
social logins and pre-existing accounts.
2024-05-06 09:14:49 +01:00
Milan Cvetkovic
4965c19b7a Re-introduce additional round trip for verifying auth_provider 2024-04-29 11:32:54 +00:00
Milan Cvetkovic
c486dd5532 Rename verified_email to email_hmac parameter in /users/new 2024-04-29 11:32:54 +00:00
Milan Cvetkovic
9649b192c0 Add preferred provider social signup
- Add preferred provider for authorization to login and signup pages.
  To use, the 3rd party application would have to add `preferred_provider=...`
  parameter to OAuth2 authorization request.
- Resize 3rd party provider icons
- Add "login to authorize" heading to login and signup screens
2024-04-29 11:32:54 +00:00
Milan Cvetkovic
0c7c950149 Add social signin buttons to signup screen, avoid repeating round trip to auth provider. 2024-04-27 12:44:10 +01:00
Milan Cvetkovic
f8a606869e Remove email confirmation field in signup form 2024-04-27 12:44:09 +01:00
Milan Cvetkovic
1276fb944a Merge login and terms screens, assume TOU and contributor terms are accepted on /user/new form
This eliminates the need for "terms" screen after /user/new form..
Terms screen is still required for legacy users who never accepted the terms.
2024-04-27 12:44:09 +01:00
Anton Khorev
f0d05c20ae Add found users count to users page 2024-03-26 05:44:35 +03:00
Anton Khorev
9f8e4fd60a Use before/after pagination on users page 2024-03-26 05:44:35 +03:00
Andy Allan
52f755cb27
Merge pull request #4535 from tomhughes/rails-tokens
Use rails generated tokens for emails
2024-02-25 11:32:15 +01:00
Tom Hughes
1b5200b797 Treat github and wikipedia provided emails as confirmed
Fixes #4270
2024-02-25 10:04:18 +00:00
Tom Hughes
4dff06a629 Use rails tokens for signup confirmations 2024-02-24 13:53:05 +00:00
Tom Hughes
242a4a1aee Include both copies of the password in the saved user
This allows is to go back to hashing passwords when the user is saved.

Fixes #4474
2024-01-12 17:55:16 +00:00
Milan Cvetkovic
a4c23cd89f Implement allow list for account creation 2023-12-17 07:55:43 +00:00
Milan Cvetkovic
aeb4271a27 Do not merge zoom/lat/lon options with oauth_return_url 2023-11-21 13:01:52 +00:00
Milan Cvetkovic
1fbd1d11c4 Extract welcome_options function to simplify save function 2023-11-21 11:56:09 +00:00
Milan Cvetkovic
87a5a0844b Welcome screen works with confirmation email too 2023-11-21 11:56:09 +00:00
Milan Cvetkovic
60c885d071 Welcome screen displays 'Continue with authorization'
do not hide notes
2023-11-21 11:56:09 +00:00
Tom Hughes
aaed886890 Hash passwords as soon as a new user is created 2023-11-16 01:02:11 +00:00
Tom Hughes
b1553135fc Preserve pass_crypt_confirmation in the new user hash 2023-11-16 00:29:49 +00:00
Tom Hughes
898a3882c5 Avoid storing user records in the session during signup
This works around an issue with rails failing to preserve attribute
change flags and is in line with upstream advice against storing models
in the session in this way.

https://github.com/rails/rails/issues/49826
https://github.com/rails/rails/issues/49827
2023-10-29 10:13:28 +00:00
Anton Khorev
f5c20527aa Move email-related methods to mixin 2023-09-02 13:43:41 +03:00
Tom Hughes
63bf18a3c3 Add support for rate limiting signup requests 2023-08-22 18:45:17 +01:00
Milan Cvetkovic
ad164d384e Change provider name to "microsoft" 2023-08-20 10:19:30 +01:00
Milan Cvetkovic
568bf4939d Replace references to windowslive with microsoft_graph 2023-08-17 13:01:15 +00:00
Milan Cvetkovic
7428da74c2 Use omniauth-microsoft_graph instead of omniauth-windowslive
Omniauth-microsoft_graph correctly populates 'email' and 'name' fields used by OpenStreetMap.
It also  uses updated endpoints for Microsoft identity provider.

Use email address returned by microsoft_graph provider as a verified address.

Upgrading exisiting users from windowslive to microsoft_graph:
 - upon next login existing `windowslive` users will have to authorizei
   OpenStreetMap application to "Read Your Profile," required for proper reading
   of display name field.

The name of the identity provider in OSM is kept to 'windowslive':
 - the entries in users table with `provider == 'windowslive'`
   can be reused for microsoft_graph provider, since
   the uid field is preserved. Users will not need to repeat the sign up process.
 - OAuth2 callback is still `/auth/windowslive`, no updates to Microsoft Identity Provider portal
   App registration are necessary.
2023-08-17 13:01:15 +00:00
Tom Hughes
65d092a579 Fix new rubocop warnings 2023-08-15 18:22:45 +01:00
Andy Allan
ace8e9a9c3 Fix redirection to wiki when terms are declined
Adds missing test to pick this up.

Fixes #3826.
2022-12-21 15:39:23 +00:00
Tom Hughes
dc28f1dccc Fix new rubocop warnings 2022-11-22 18:32:02 +00:00
Andy Allan
972249ce9d Reconfigure the suspended flash message to avoid html_safe
This also avoids having raw html in the translation strings
2022-11-17 12:04:28 +00:00
Andy Allan
22946d703a Enable the ActionOrder cop for remaining controllers
Where actions were reordered, the rails standard actions were
also moved to the top of each controller.
2022-11-02 11:06:00 +00:00
Tom Hughes
e9f62a8c30 Rename piwik to matomo and merge configuration into settings 2022-08-01 22:42:04 +01:00