From 18101e3cb2ae041f0a11551561e17c4b0d2162d6 Mon Sep 17 00:00:00 2001 From: Hector Correa Date: Mon, 19 Aug 2024 20:17:09 +0200 Subject: [PATCH] Rubocop nitpicking --- app/models/user.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 7b936ac88..9d65f01cd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -59,14 +59,12 @@ def self.safe_uid(uid) end def self.email_from_access_token(access_token) - if access_token.extra.mail != nil + if !access_token.extra.mail.nil? # For typical Princeton accounts the email comes on the `email` field access_token.extra.mail elsif User.looks_like_email_address?(access_token.extra.givenname) # For Guest Access Accounts (GAP) the email comes in the `givenname` access_token.extra.givenname - else - nil end end