Class: Gitlab::Auth::OmniauthIdentityLinkerBase
- Inherits:
-
Object
- Object
- Gitlab::Auth::OmniauthIdentityLinkerBase
- Defined in:
- lib/gitlab/auth/omniauth_identity_linker_base.rb
Direct Known Subclasses
Atlassian::IdentityLinker, Gitlab::Auth::OAuth::IdentityLinker, Saml::IdentityLinker
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#oauth ⇒ Object
readonly
Returns the value of attribute oauth.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #error_message ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(current_user, oauth, session = {}) ⇒ OmniauthIdentityLinkerBase
constructor
A new instance of OmniauthIdentityLinkerBase.
- #link ⇒ Object
Constructor Details
#initialize(current_user, oauth, session = {}) ⇒ OmniauthIdentityLinkerBase
Returns a new instance of OmniauthIdentityLinkerBase.
8 9 10 11 12 13 |
# File 'lib/gitlab/auth/omniauth_identity_linker_base.rb', line 8 def initialize(current_user, oauth, session = {}) @current_user = current_user @oauth = oauth @changed = false @session = session end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
6 7 8 |
# File 'lib/gitlab/auth/omniauth_identity_linker_base.rb', line 6 def current_user @current_user end |
#oauth ⇒ Object (readonly)
Returns the value of attribute oauth.
6 7 8 |
# File 'lib/gitlab/auth/omniauth_identity_linker_base.rb', line 6 def oauth @oauth end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
6 7 8 |
# File 'lib/gitlab/auth/omniauth_identity_linker_base.rb', line 6 def session @session end |
Instance Method Details
#changed? ⇒ Boolean
19 20 21 |
# File 'lib/gitlab/auth/omniauth_identity_linker_base.rb', line 19 def changed? @changed end |
#error_message ⇒ Object
27 28 29 30 31 |
# File 'lib/gitlab/auth/omniauth_identity_linker_base.rb', line 27 def identity.validate identity.errors..join(', ') end |
#failed? ⇒ Boolean
23 24 25 |
# File 'lib/gitlab/auth/omniauth_identity_linker_base.rb', line 23 def failed? .present? end |
#link ⇒ Object
15 16 17 |
# File 'lib/gitlab/auth/omniauth_identity_linker_base.rb', line 15 def link save if unlinked? end |