when redirected from the login page, go straight into sessionView
This commit is contained in:
parent
bc09084ec2
commit
32fea5be69
@ -12,15 +12,16 @@ define [
|
||||
routes:
|
||||
'session': 'showSession',
|
||||
'login': 'showLogin',
|
||||
|
||||
# '*actions': 'defaultAction'
|
||||
|
||||
initialize: ->
|
||||
@appView = new AppView()
|
||||
|
||||
showLogin: () ->
|
||||
showLogin: () ->#TEMP I want to show the session window right away
|
||||
globals.router.navigate "/login", {replace: true}
|
||||
@loginView ?= new LoginView()
|
||||
@appView.render(@loginView)
|
||||
@sessionView ?= new SessionView()#TEMP I want to show the session window right away
|
||||
@appView.render(@sessionView)#TEMP I want to show the session window right away
|
||||
|
||||
showSession: () ->
|
||||
globals.router.navigate "/session", {replace: true}
|
||||
|
@ -38,6 +38,6 @@ module.exports = class MainRouter
|
||||
"user_id=#{userId}\n" +
|
||||
"auth_token=#{authToken}\n\n"
|
||||
|
||||
#render a blank page page.html
|
||||
res.render "session",
|
||||
#go straight into the session view
|
||||
res.render "index",
|
||||
title: config.appName
|
@ -19,30 +19,37 @@ login = (req, resp) ->
|
||||
bbbapi.create(createParams, serverAndSecret, {}, (errorOuter, responseOuter, bodyOuter) ->
|
||||
#console.log JSON.stringify(response)
|
||||
bbbapi.join(joinParams, serverAndSecret, {}, (error, response, body) ->
|
||||
xml = '' + response.body
|
||||
#console.log "\n\nxml=" + xml
|
||||
|
||||
{parseString} = require 'xml2js'
|
||||
parseString(xml, (err, result) ->
|
||||
meeting_id = result.response.meeting_id
|
||||
user_id = result.response.user_id
|
||||
auth_token = result.response.auth_token
|
||||
console.log "\nmeeting_id = " + meeting_id +
|
||||
"\nuser_id = " + user_id +
|
||||
"\nauth_token = " + auth_token
|
||||
if error
|
||||
console.log error
|
||||
else
|
||||
xml = '' + response.body
|
||||
console.log "\n\nxml=" + xml
|
||||
|
||||
{parseString} = require 'xml2js'
|
||||
parseString(xml, (err, result) ->
|
||||
if err
|
||||
console.log "Error: " + err
|
||||
else
|
||||
meeting_id = result.response.meeting_id
|
||||
user_id = result.response.user_id
|
||||
auth_token = result.response.auth_token
|
||||
console.log "\nmeeting_id = " + meeting_id +
|
||||
"\nuser_id = " + user_id +
|
||||
"\nauth_token = " + auth_token
|
||||
|
||||
#url = "http:/192.168.0.203/html5.client?meeting_id=" + meeting_id + "&user_id=" + user_id + "&auth_token=" + auth_token
|
||||
url = "192.168.0.203:3000/html5.client?meeting_id=" + meeting_id + "&user_id=" + user_id + "&auth_token=" + auth_token
|
||||
json =
|
||||
resp.json({
|
||||
success: {
|
||||
url: url
|
||||
},
|
||||
failure: {
|
||||
message: "Something went terribly wrong"
|
||||
}
|
||||
})
|
||||
)
|
||||
url = "http://192.168.0.203:3000/html5.client?meeting_id=" + meeting_id + "&user_id=" +
|
||||
user_id + "&auth_token=" + auth_token
|
||||
|
||||
json =
|
||||
resp.json({
|
||||
success: {
|
||||
url: url
|
||||
},
|
||||
failure: {
|
||||
message: "Something went terribly wrong"
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -10,10 +10,7 @@ myModule.controller('MainCtrl', function($scope, $http, $location, $window) {
|
||||
jQuery.getJSON("config.json", function (json) {
|
||||
$http.post('/login', account).success(function(res) {
|
||||
//alert(res.success.url);
|
||||
|
||||
//TODO check if I really need $location
|
||||
|
||||
$scope.myurl = res.success.url;
|
||||
$window.location.href = res.success.url;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
<div ng-controller="MainCtrl">
|
||||
<form ng-submit="postUsername()">
|
||||
<input type="submit" value="Send"> <br /><br />
|
||||
<a ng-href="http://{{myurl}}">HTML5 CLIENT</a>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user