forked from External/greenlight
* <Added omniauth for office365> * <Fixed code style> * Update puma.rb * <Inserted link to documentation>
This commit is contained in:
@ -60,7 +60,12 @@ class User < ApplicationRecord
|
||||
|
||||
# Provider attributes.
|
||||
def auth_name(auth)
|
||||
auth['info']['name']
|
||||
case auth['provider']
|
||||
when :microsoft_office365
|
||||
auth['info']['display_name']
|
||||
else
|
||||
auth['info']['name']
|
||||
end
|
||||
end
|
||||
|
||||
def auth_username(auth)
|
||||
@ -83,7 +88,7 @@ class User < ApplicationRecord
|
||||
when :twitter
|
||||
auth['info']['image'].gsub("http", "https").gsub("_normal", "")
|
||||
else
|
||||
auth['info']['image']
|
||||
auth['info']['image'] unless auth['provider'] == :microsoft_office365
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user