Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
255 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class SessionsLookupLogin | ||
|
||
lev_handler | ||
|
||
paramify :login do | ||
attribute :username_or_email, type: String | ||
validates :username_or_email, presence: true | ||
end | ||
|
||
protected | ||
|
||
def authorized? | ||
true | ||
end | ||
|
||
def handle | ||
users = LookupUsers.by_email_or_username(login_params.username_or_email) | ||
|
||
fatal_error(code: :unknown_username_or_email) if users.empty? | ||
|
||
outputs.names = users.map(&:standard_name).uniq | ||
outputs.username_or_email = login_params.username_or_email | ||
outputs.providers = Authentication.where{user_id.in users.map(&:id)} | ||
.map(&:provider) | ||
.uniq | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<% @parent_col_id = "signin" %> | ||
<%= page_heading (t :".page_heading"), sub_heading_text: (t :".page_sub_heading"), center: true %> | ||
<% login_info = get_login_info %> | ||
|
||
<h3> | ||
Hi<%= login_info[:names].size == 1 ? " #{login_info[:names].first}!" : "!" %> | ||
</h3> | ||
|
||
<div id="options" class="row"> | ||
<div class="col-sm-12"> | ||
|
||
<% if login_info[:providers].include?('identity') %> | ||
<div class="button-form-group"> | ||
<%= form_tag '/auth/identity/callback' do %> | ||
<input type='hidden' id='auth_key' name='auth_key' class="form-control" | ||
value='<%= login_info[:username_or_email] %>'/> | ||
<div class="form-group"> | ||
<label for='password'><%= t :".password" %></label> | ||
<input type='password' id='password' name='password' class="form-control"/> | ||
</div> | ||
|
||
<div class='password-actions'> | ||
<button type="submit" class="btn btn-primary"><%= t :".sign_in" %></button> | ||
</div> | ||
|
||
<% end %> | ||
</div> | ||
|
||
<% if login_info[:providers].size > 1 %> | ||
<div id="horizontal-or-bar"> | ||
<span><%= t :".separator_or" %></span> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% if login_info[:providers].include?('facebook') %> | ||
<%= link_to "/auth/facebook", class: 'btn btn-block btn-social btn-facebook', | ||
id: 'facebook-login-button' do %> | ||
<span class="fa fa-facebook"></span> <%= t :".sign_in_with_facebook" %> | ||
<% end %> | ||
<% end %> | ||
<% if login_info[:providers].include?('google_oauth2') %> | ||
<%= link_to "/auth/google_oauth2", class: 'btn btn-block btn-social btn-google', | ||
id: 'google-login-button' do %> | ||
<span class="fa fa-google"></span> <%= t :".sign_in_with_google" %> | ||
<% end %> | ||
<% end %> | ||
|
||
</div> | ||
</div> | ||
|
||
<div id="cant-sign-in" class="row"> | ||
<div class="col-xs-12" style='text-align: center'> | ||
<span><%= link_to (t :".cant_sign_in"), login_help_path %></span> | ||
</div> | ||
</div> | ||
|
||
<div id="reminders" class="row"> | ||
<div class="col-xs-12"> | ||
<p><%= t :".openstax_wont_use_social_media_without_permission_html" %> | ||
|
||
<style type="text/css"> | ||
p.b-no-wrap > b { | ||
white-space: nowrap; | ||
} | ||
</style> | ||
<p class="b-no-wrap"> | ||
<%= t :".logout_reminder_html" %> | ||
</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p>start.html.erb</p> | ||
|
||
<p>Solicit role and email address</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p>verify_email.html.erb</p> | ||
|
||
<p>Verify email by PIN (during signup)</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.