mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Ensure email links return to proper path on private shops, refactor modal logic
This commit is contained in:
committed by
Maikel Linke
parent
ea9b0eca48
commit
e6bdbccffa
@@ -4,13 +4,8 @@ Darkswarm.factory "AuthenticationService", (Navigation, $modal, $location, Redir
|
||||
selectedPath: "/login"
|
||||
|
||||
constructor: ->
|
||||
if $location.path() in ["/login", "/signup", "/forgot"] && location.pathname isnt '/register/auth'
|
||||
@open $location.path()
|
||||
else if location.pathname is '/register/auth'
|
||||
if angular.isDefined($location.search()['validation'])
|
||||
@open '/login', 'registration_authentication.html'
|
||||
else
|
||||
@open '/signup', 'registration_authentication.html'
|
||||
if $location.path() in ["/login", "/signup", "/forgot"] || location.pathname is '/register/auth'
|
||||
@open @initialTab(), @initialTemplate()
|
||||
|
||||
open: (path = false, template = 'authentication.html') =>
|
||||
@modalInstance = $modal.open
|
||||
@@ -20,6 +15,19 @@ Darkswarm.factory "AuthenticationService", (Navigation, $modal, $location, Redir
|
||||
@selectedPath = path || @selectedPath
|
||||
Navigation.navigate @selectedPath
|
||||
|
||||
initialTab: ->
|
||||
if angular.isDefined($location.search()['validation'])
|
||||
'/login'
|
||||
else if location.pathname is '/register/auth'
|
||||
'/signup'
|
||||
else
|
||||
$location.path()
|
||||
|
||||
initialTemplate: ->
|
||||
if location.pathname is '/register/auth'
|
||||
'registration_authentication.html'
|
||||
else
|
||||
'authentication.html'
|
||||
|
||||
select: (path)=>
|
||||
@selectedPath = path
|
||||
|
||||
Reference in New Issue
Block a user