mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Make auth URLs friendlier to load balancers and allow partials to be loaded as well.
This commit is contained in:
parent
beff3d88f2
commit
b19e1784ab
6 changed files with 18 additions and 10 deletions
|
@ -50,7 +50,7 @@ module.exports = function(options) {
|
|||
next()
|
||||
})
|
||||
|
||||
app.get('/partials/:name', function(req, res) {
|
||||
app.get('/static/auth/ldap/views/partials/:name.html', function(req, res) {
|
||||
var whitelist = {
|
||||
'signin': true
|
||||
}
|
||||
|
@ -64,6 +64,10 @@ module.exports = function(options) {
|
|||
})
|
||||
|
||||
app.get('/', function(req, res) {
|
||||
res.redirect('/auth/ldap')
|
||||
})
|
||||
|
||||
app.get('/auth/ldap', function(req, res) {
|
||||
res.render('index')
|
||||
})
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ module.exports = function(options) {
|
|||
next()
|
||||
})
|
||||
|
||||
app.get('/partials/:name', function(req, res) {
|
||||
app.get('/static/auth/mock/views/partials/:name.html', function(req, res) {
|
||||
var whitelist = {
|
||||
'signin': true
|
||||
}
|
||||
|
@ -63,6 +63,10 @@ module.exports = function(options) {
|
|||
})
|
||||
|
||||
app.get('/', function(req, res) {
|
||||
res.redirect('/auth/mock')
|
||||
})
|
||||
|
||||
app.get('/auth/mock', function(req, res) {
|
||||
res.render('index')
|
||||
})
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@ define(['./app'], function(app) {
|
|||
, function($routeProvider, $locationProvider) {
|
||||
$locationProvider.html5Mode(true)
|
||||
$routeProvider
|
||||
.when('/', {
|
||||
templateUrl: 'partials/signin'
|
||||
.when('/auth/ldap', {
|
||||
templateUrl: '/static/auth/ldap/views/signin.html'
|
||||
, controller: 'SignInCtrl'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/'
|
||||
redirectTo: '/auth/ldap'
|
||||
})
|
||||
}
|
||||
])
|
||||
|
|
|
@ -7,5 +7,5 @@ html
|
|||
include partials/styles
|
||||
body(ng-cloak)
|
||||
div(ng-view)
|
||||
script(src='/static/bower_components/requirejs/require.js', data-main='static/auth/ldap/scripts/main.js')
|
||||
script(src='/static/bower_components/requirejs/require.js', data-main='/static/auth/ldap/scripts/main.js')
|
||||
script(src='/static/bower_components/stf-analytics/analytics.js')
|
||||
|
|
|
@ -5,12 +5,12 @@ define(['./app'], function(app) {
|
|||
, function($routeProvider, $locationProvider) {
|
||||
$locationProvider.html5Mode(true)
|
||||
$routeProvider
|
||||
.when('/', {
|
||||
templateUrl: 'partials/signin'
|
||||
.when('/auth/mock', {
|
||||
templateUrl: '/static/auth/mock/views/partials/signin.html'
|
||||
, controller: 'SignInCtrl'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/'
|
||||
redirectTo: '/auth/mock'
|
||||
})
|
||||
}
|
||||
])
|
||||
|
|
|
@ -7,5 +7,5 @@ html
|
|||
include partials/styles
|
||||
body(ng-cloak)
|
||||
div(ng-view)
|
||||
script(src='/static/bower_components/requirejs/require.js', data-main='static/auth/mock/scripts/main.js')
|
||||
script(src='/static/bower_components/requirejs/require.js', data-main='/static/auth/mock/scripts/main.js')
|
||||
script(src='/static/bower_components/stf-analytics/analytics.js')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue