Prepare view & controller

This commit is contained in:
Alex Sherman 2020-09-23 13:01:33 +05:00
parent 8ff92548bf
commit ffeb1d4baa
6 changed files with 2612 additions and 388 deletions

View file

@ -16,17 +16,18 @@ class User < ApplicationRecord
# rubocop:disable Metrics/AbcSize
def tampered_with?(omniauth_hash)
uid_from_hash = omniauth_hash['uid']
provider_from_hash = omniauth_hash['provider']
begin
uid != uid_from_hash ||
provider != provider_from_hash ||
country_code != uid_from_hash.slice(0..1) ||
identity_code != uid_from_hash.slice(2..-1) ||
given_names != omniauth_hash.dig('info', 'first_name') ||
surname != omniauth_hash.dig('info', 'last_name')
end
# uid_from_hash = omniauth_hash['uid']
# provider_from_hash = omniauth_hash['provider']
#
# begin
# uid != uid_from_hash ||
# provider != provider_from_hash ||
# country_code != uid_from_hash.slice(0..1) ||
# identity_code != uid_from_hash.slice(2..-1) ||
# given_names != omniauth_hash.dig('info', 'first_name') ||
# surname != omniauth_hash.dig('info', 'last_name')
# end
false
end
# rubocop:enable Metrics/AbcSize