Commit Graph

37 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
5cb5f19e4f Use IDPMetadataParse to set up the Idp SAML settings
Co-authored-by: Anamika Aggarwal <anamikaagg18@gmail.com>
2025-07-23 14:43:44 +02:00
Javi Martín
6190d808ba Allow different times between IDP and SP machines
We were having an issue because there was a difference of about 11
seconds between the local times of our machines and the time of the IDP
server. Since right now we can't guarantee the time of these machines is
fully synchronized, for now we're adding a margin of error of one
minute.
2025-07-23 14:43:44 +02:00
taitus
a4709f9da0 Add omniauth saml section for sign in and sign up page
Co-authored-by: Anamika Aggarwal <anamikaagg18@gmail.com>
2025-07-23 14:43:44 +02:00
Javi Martín
1af5c18bd7 Load OmniauthTenantSetup inside a lambda
This way we avoid loading the OmniauthTenantSetup in the initializer,
which could be problematic when switching to Zeitwerk.
2024-04-11 19:08:02 +02:00
Javi Martín
1cf529b134 Make Devise find the strategy class automatically
Since we're already setting `wordpress_oauth2` using the `option :name`
command in the `OmniAuth::Strategies::Wordpress` class, Devise can
automatically find the strategy. However, it wasn't working because we
were passing a string instead of a symbol.
2024-04-11 19:08:02 +02:00
Javi Martín
d8faa4f4d0 Follow Zeitwerk conventions for file structure
Even though we don't load this file with Zeitwerk, we're doing it for
consistency.

If we tried to load this file using Zeitwerk, without this change we'd
get an error:

```
NameError: uninitialized constant OmniauthWordpress
```
2024-04-11 19:08:02 +02:00
Javi Martín
8d2c2c473e Base Devise initializer on the latest version
We haven't updated this initializer for years, so here's the updated
version. The `expire_auth_token_on_timeout` doesn't seem to exist
anymore, and a few more options have been added.

Note that the default Devise initializer configures
`config.responder.error_status` and `config.responder.redirect_status`
so they follow Hotwire/Turbo conventions. For now, I'm commenting these
lines because we currently don't use Hotwire/Turbo.
2024-03-23 01:12:35 +01:00
taitus
d54a5c2ae0 Allow define maximum_attemps and unlock_in 2023-10-24 20:21:03 +02:00
taitus
a1955531e1 Enable devise lockable module with default values
In order to the display a warn text on the last attempt
before the account is locked, we need update
config.paranoid to false as the devise documentation
explains.

Adding "config.paranoid: false" implies further changes
to the code, so for now we unncomment the default value
"config.last_attempt_warning = true" and update it to false.
2023-10-24 20:20:27 +02:00
Eduardo Vilar
0ea61b9b61 Allow different omniauth settings per tenant
Co-Authored-By: Javi Martín <javim@elretirao.net>
2022-11-11 01:39:30 +01:00
Javi Martín
a729967e8a Make Devise::Mailer inherit from ApplicationMailer
This way we remove duplication in the `from:` proc, the helpers, and the
methods we're about to write.
2022-10-06 13:18:05 +02:00
Julian Herrero
193e51d42f Enable Wordpress Oauth login and registration 2020-02-07 12:23:41 +07:00
Javi Martín
ddb37f89ae Apply Style/Proc rubocop rule
While I tend to use `Proc.new`, using `proc` is shorter and more
consistent since we also use `lambda`.
2019-10-26 13:22:49 +02:00
Javi Martín
66da02f1de Evaluate mailer from address at runtime
We're reading the value from the database, but the
`ApplicationMailer.default` method is evaluated when the application is
started. So if we don't use a Proc, we'll need to restart the server
every time we change the value in the database, or else the old value
will still be used.

Using a Proc makes sure the mailer from address is evaluated at runtime,
so emails are sent using the from address currently defined in the
database.

The same situation took place using the devise mailer. Now we don't need
to check for the settings table being present because the Proc in the
devise initializer won't be evaluated before the settings table is
created and populated.
2019-09-10 15:59:59 +02:00
decabeza
c2acd53a06 Change devise configuration
This change don't let the user know if the email address exists when asking to resend confirmation or password reset instructions.
2019-05-28 14:23:37 +02:00
Julian Herrero
f668317cc1 Use #data_source_exists? instead of #table_exists?
DEPRECATION WARNING: #table_exists? currently checks both tables and
views. This behavior is deprecated and will be changed with Rails 5.1
to only check tables. Use #data_source_exists? instead.
2019-04-17 17:40:55 +02:00
Javi Martín
4c35df4812 Use double quotes inside string interpolation 2019-03-25 14:58:54 +01:00
Julian Herrero
a8d8d2cdf9 Use double quotes in config/initializers 2019-03-15 10:29:03 +01:00
Daniel
a715df3431 fix the warning of secret_key for devise 2017-11-15 08:10:14 -06:00
rgarcia
0049b6154c testing devise mailer 2017-01-10 20:04:01 +01:00
Fernando Blat
8350143496 Don't fetch setting if table doesn't exist 2017-01-04 13:37:55 +01:00
Fernando Blat
85ce7d7227 Devise won't read mail from Settings in test environment 2016-12-23 15:45:20 +01:00
Fernando Blat
a07fbc5b41 Extract mailer from name and address to a setting 2016-12-23 11:28:53 +01:00
Alberto Garcia Cabeza
42722080fc Changes references to Madrid 2016-07-05 13:47:14 +02:00
kikito
4bac9e6ea1 updates oauth code to handle faulty facebook responses better 2016-01-27 18:36:22 +01:00
kikito
1617f7295c requests omniauth facebook email 2016-01-26 18:15:39 +01:00
Josep Jaume Rey Peroy
cf00f12ec7 Store locale in a user's field and switch locale on mailers 2016-01-22 18:10:28 +01:00
Josep Jaume Rey Peroy
1c9a4c8ec6 Use secret_key_base as devise's secret key 2016-01-21 08:52:23 +01:00
Juanjo Bazán
c9e688fc72 changes devise's défault email address 2015-09-01 11:45:11 +02:00
Alberto Garcia Cabeza
86369200ba Adds mailer layout to instructions emails 2015-08-26 19:42:51 +02:00
David Gil
59aede5b00 adds Google OAuth2 support 2015-08-25 14:15:24 +02:00
David Gil
86dccac9c6 adds support for Facebook OAuth 2015-08-24 20:24:54 +02:00
David Gil
158e203936 adds omniauth basic authentication process with Twitter, including an intermediate step to ask the user for her email if not provided by the OAuth provider - Twitter, for instance 2015-08-24 20:24:54 +02:00
kikito
8ca546a431 merges master and fixes conflicts 2015-08-17 02:40:11 +02:00
kikito
1f2f318e83 Turns on devise scoped views
That way we can have users/registrations & organizations/registrations
2015-08-17 01:16:07 +02:00
rgarcia
76826af7dd adds fixes for staging deploys 2015-08-14 18:09:05 +02:00
rgarcia
f618a9f45d adds devise configuration [#6] 2015-07-16 19:47:54 +02:00