Commit 5446c79c authored by Randall Leeds's avatar Randall Leeds

Move h.auth -> h.account on frontend

parent 11466a79
......@@ -85,5 +85,5 @@ class AccountController
angular.module('h.auth')
angular.module('h.account')
.controller('AccountController', AccountController)
......@@ -22,16 +22,16 @@ class AuthAppController
onlogin = ->
$window.location.href = '/stream'
$scope.auth = {}
$scope.account = {}
$scope.model = {}
$scope.auth.tab = $location.path().split('/')[1]
$scope.account.tab = $location.path().split('/')[1]
$scope.$on 'auth', (event, err, data) ->
if data?.userid
$timeout onlogin, 1000
$scope.$watch 'auth.tab', (tab, old) ->
$scope.$watch 'account.tab', (tab, old) ->
unless tab is old then $location.path("/#{tab}")
# TODO: We should be calling identity.beginProvisioning() here in order to
......@@ -126,6 +126,6 @@ configure = [
]
angular.module('h.auth', imports, configure)
angular.module('h.account', imports, configure)
.controller('AuthAppController', AuthAppController)
.controller('AuthPageController', AuthPageController)
......@@ -7,12 +7,12 @@ class AuthController
if data.userid
$scope.$emit 'auth', null, data
$scope.auth.tab =
switch $scope.auth.tab
$scope.account.tab =
switch $scope.account.tab
when 'register' then 'login'
when 'forgot_password' then 'reset_password'
when 'reset_password' then 'login'
else $scope.auth.tab
else $scope.account.tab
angular.copy {}, $scope.model
$scope.form?.$setPristine()
......@@ -30,7 +30,7 @@ class AuthController
angular.bind(this, failure, form)
.$promise.finally -> $scope.$broadcast 'formState', form.$name, ''
$scope.auth ?= tab: 'login'
$scope.account ?= tab: 'login'
$scope.model ?= {}
$scope.$on 'auth', do ->
......@@ -53,5 +53,5 @@ class AuthController
, 300000
angular.module('h.auth')
angular.module('h.account')
.controller('AuthController', AuthController)
......@@ -3,7 +3,7 @@ imports = [
'ngRoute'
'ngSanitize'
'ngTagsInput'
'h.auth'
'h.account'
'h.helpers'
'h.identity'
'h.streamer'
......
......@@ -2,8 +2,8 @@
tab-reveal="['forgot_password', 'reset_password']"
ng-controller="AuthController as vm"
ng-form="form"
ng-model="auth.tab"
ng-submit="vm.submit(form[auth.tab])">
ng-model="account.tab"
ng-submit="vm.submit(form[account.tab])">
<!-- Login -->
<form data-title="Sign in"
data-value="login"
......@@ -54,7 +54,7 @@
<div class="form-actions">
<div class="form-actions-message">
<a href="" ng-click="auth.tab = 'forgot_password'"
<a href="" ng-click="account.tab = 'forgot_password'"
>Forgot your password?</a>
</div>
<div class="form-actions-buttons">
......
......@@ -44,7 +44,7 @@ module.exports = function(config) {
'h/static/scripts/plugin/discovery.js',
'h/static/scripts/plugin/threading.js',
'h/static/scripts/app.js',
'h/static/scripts/auth.js',
'h/static/scripts/account.js',
'h/static/scripts/helpers.js',
'h/static/scripts/session.js',
'h/static/scripts/hypothesis.js',
......
......@@ -2,7 +2,7 @@ assert = chai.assert
sinon.assert.expose assert, prefix: null
sandbox = sinon.sandbox.create()
describe 'h.auth.AccountController', ->
describe 'h.account.AccountController', ->
$scope = null
fakeFlash = null
fakeSession = null
......@@ -13,7 +13,7 @@ describe 'h.auth.AccountController', ->
profilePromise = null
createController = null
beforeEach module('h.auth')
beforeEach module('h.account')
beforeEach module ($provide, $filterProvider) ->
fakeSession = {}
......
......@@ -19,8 +19,8 @@ class MockSession
mockFlash = sandbox.spy()
mockFormHelpers = applyValidationErrors: sandbox.spy()
describe 'h.auth', ->
beforeEach module('h.auth')
describe 'h.account', ->
beforeEach module('h.account')
beforeEach module('h.templates')
beforeEach module ($provide) ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment