Skip to content
Snippets Groups Projects

Improve hyrax/seed/setup.json user creation (no hardcoded passwords, added Shibboleth support)

2 files
+ 2
38
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 2
2
@@ -78,7 +78,7 @@ class User < ApplicationRecord
if ENV.fetch('ORCID_RESTRICT_AUTHORIZATION', 'true') == 'false'
user.display_name = auth.info.name
user.email = auth.info.email || "#{auth.uid}@#{auth.provider.to_s}"
user.password = Devise.friendly_token[0,20]
user.password = SecureRandom.random_bytes(32)
end
user.save!
user
@@ -108,7 +108,7 @@ class User < ApplicationRecord
user.uid = attributes[:uid]
user.display_name = attributes[:name]
user.email = attributes[:email]
user.password = Devise.friendly_token[0,20]
user.password = SecureRandom.random_bytes(32)
user.save!
user
Loading