-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More client side authentication work and work on annotations
modified: ../app/controllers/audio_events_controller.rb -- more attempts at fixing bug #57 modified: ../app/assets/javascripts/angular/controllers/annotation_viewer.js modified: ../app/assets/javascripts/angular/controllers/login.js modified: ../app/assets/javascripts/angular/directives/auth.js modified: ../app/assets/javascripts/angular/directives/directives.js modified: ../app/assets/javascripts/angular/services/services.js modified: ../app/assets/stylesheets/_login_control.css.scss modified: ../app/views/layouts/application.html.erb -- added support for more types of authentication providers modified: ../config/initializers/devise.rb -- removed basic auth for images modified: ../lib/assets/javascripts/jquery.drawabox.js -- deleted unecessary comma modified: ../lib/assets/javascripts/functions.js -- added uri encoder ../app/serializers/ new file: ../config/initializers/active_model_serializers.rb modified: ../config/initializers/active_model_serializers.rb modified: ../Gemfile modified: ../Gemfile.lock -- added active_model_serializers gem for easier json formatting modified: ../app/models/audio_event.rb -- removed uncessaaey json formatting
- Loading branch information
Showing
11 changed files
with
207 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,41 @@ | ||
function LoginCtrl($scope, $http, authService, PersonaAuthenticator) { | ||
function LoginCtrl($scope, $http, authService, AuthenticationProviders) { | ||
|
||
$scope.requireMoreInformation = null; | ||
$scope.additionalInformation = null; | ||
|
||
|
||
$scope.submit = function (provider) { | ||
|
||
switch (provider) { | ||
case "persona": | ||
PersonaAuthenticator.login(); | ||
break; | ||
default: | ||
throw "Provider not matched"; | ||
var authProvider = AuthenticationProviders[provider]; | ||
|
||
if (!authProvider) { | ||
throw "LoginCtrl:submit: Unknown Provider!" | ||
} | ||
|
||
// console.info(result); | ||
if (authProvider.requires) { | ||
|
||
if (!$scope.additionalInformation || $scope.additionalInformation == "" /* && validation check */) { | ||
$scope.requireMoreInformation = authProvider.requires; | ||
$scope.requireMoreInformation.providerId = provider; | ||
return; | ||
} | ||
|
||
|
||
authProvider.login($scope.additionalInformation); | ||
|
||
$scope.requireMoreInformation = null; | ||
$scope.additionalInformation = undefined; | ||
} | ||
else { | ||
$scope.requireMoreInformation = null; | ||
|
||
authProvider.login(); | ||
} | ||
}; | ||
|
||
$scope.logout = function() { | ||
|
||
//$http.post(path).success(function () { | ||
// authService.loginConfirmed(); | ||
//}); | ||
} | ||
} | ||
LoginCtrl.$inject = ['$scope', '$http', 'authService', 'PersonaAuthenticator']; | ||
|
||
LoginCtrl.$inject = ['$scope', '$http', 'authService', 'AuthenticationProviders']; |
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
Oops, something went wrong.