mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge remote-tracking branch 'guerler/login_routes' into dev
This commit is contained in:
@@ -95,13 +95,16 @@ window.app = function app( options, bootstrapped ){
|
||||
var queryObj = QUERY_STRING.parse( args.pop() );
|
||||
args.push( queryObj );
|
||||
if( callback ){
|
||||
callback.apply( this, args );
|
||||
if ( this.authenticate( args, name ) ) {
|
||||
callback.apply( this, args );
|
||||
} else {
|
||||
this.push( Galaxy.root );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
routes : {
|
||||
'(/)' : 'home',
|
||||
// TODO: remove annoying 'root' from root urls
|
||||
'(/)root*' : 'home',
|
||||
'(/)tours(/)(:tour_id)' : 'show_tours',
|
||||
'(/)user(/)' : 'show_user',
|
||||
@@ -109,6 +112,15 @@ window.app = function app( options, bootstrapped ){
|
||||
'(/)custom_builds' : 'show_custom_builds'
|
||||
},
|
||||
|
||||
require_login: [
|
||||
'show_user',
|
||||
'show_user_form'
|
||||
],
|
||||
|
||||
authenticate: function( args, name ) {
|
||||
return ( Galaxy.user && Galaxy.user.id ) || this.require_login.indexOf( name ) == -1;
|
||||
},
|
||||
|
||||
show_tours : function( tour_id ){
|
||||
if ( tour_id ){
|
||||
Tours.giveTour( tour_id );
|
||||
@@ -197,4 +209,4 @@ window.app = function app( options, bootstrapped ){
|
||||
pushState : true,
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user