Skip to content

Commit 62207bb

Browse files
committed
keep calnet old code for reference
1 parent c0d764f commit 62207bb

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

app/models/user.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,31 @@ class User < ApplicationRecord
99
:recoverable, :rememberable, :validatable,
1010
:omniauthable, omniauth_providers: [:cas]
1111

12+
# old code for omniauth, kept for reference
13+
# class << self
14+
# # Finds or creates a user record given data from the omniauth request hash
15+
# def from_calnet(auth)
16+
# where(calnet_uid: auth.uid).first_or_initialize do |user|
17+
# user.email = auth.extra['berkeleyEduOfficialEmail'] || fake_email if user.email.blank?
18+
# user.save!
19+
# end
20+
# end
21+
22+
# private
23+
24+
# # Generates a random email address
25+
# def fake_email
26+
# "fake-#{SecureRandom.hex[0, 16]}@noemail.com"
27+
# end
28+
# end
29+
30+
# # Method added by Blacklight; Blacklight uses #to_s on your
31+
# # user class to get a user-displayable login/identifier for
32+
# # the account.
33+
# def to_s
34+
# email
35+
# end
36+
1237
# Configuration added by Blacklight; Blacklight::User uses a method key on your
1338
# user class to get a user-displayable login/identifier for
1439
# the account.

0 commit comments

Comments
 (0)