Fixed #291 Added OAuth2 for Office365 (GRN-32) (#293)

* <Added omniauth for office365>

* <Fixed code style>

* Update puma.rb

* <Inserted link to documentation>
This commit is contained in:
John Ma
2018-10-16 12:58:06 -04:00
committed by Jesus Federico
parent 90b965d03f
commit ec250f3ed5
7 changed files with 38 additions and 3 deletions

View File

@ -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