Const OpenViduRole changed to variable when storing in collections

This commit is contained in:
pabloFuente 2017-06-19 10:18:08 +02:00
parent 10b1eb8188
commit 1225542130
5 changed files with 10 additions and 10 deletions

View File

@ -230,7 +230,7 @@ else {
// Store the session and the token in our collections
this.mapSessions.put(sessionName, session);
this.mapSessionIdsTokens.put(sessionId, new ConcurrentHashMap<>());
this.mapSessionIdsTokens.get(sessionId).put(token, OpenViduRole.PUBLISHER);
this.mapSessionIdsTokens.get(sessionId).put(token, role);
// Prepare the response with the sessionId and the token
responseJson.put(0, sessionId);
@ -336,7 +336,7 @@ if (this.mapSessions.get(sessionName) != null) {
String token = this.mapSessions.get(sessionName).generateToken(tokenOptions);
// Update our collection storing the new token
this.mapSessionIdsTokens.get(sessionId).put(token, OpenViduRole.PUBLISHER);
this.mapSessionIdsTokens.get(sessionId).put(token, role);
// Prepare the response with the sessionId and the token
responseJson.put(0, sessionId);

View File

@ -66,7 +66,7 @@ public class SessionController {
String sessionId = this.mapSessions.get(sessionName).getSessionId();
String token = this.mapSessions.get(sessionName).generateToken(tokenOptions);
this.mapSessionIdsTokens.get(sessionId).put(token, OpenViduRole.PUBLISHER);
this.mapSessionIdsTokens.get(sessionId).put(token, role);
responseJson.put(0, sessionId);
responseJson.put(1, token);
@ -86,7 +86,7 @@ public class SessionController {
this.mapSessions.put(sessionName, session);
this.mapSessionIdsTokens.put(sessionId, new ConcurrentHashMap<>());
this.mapSessionIdsTokens.get(sessionId).put(token, OpenViduRole.PUBLISHER);
this.mapSessionIdsTokens.get(sessionId).put(token, role);
responseJson.put(0, sessionId);
responseJson.put(1, token);

View File

@ -214,7 +214,7 @@ else {
// Store the session and the token in our collections
this.mapSessions.put(sessionName, session);
this.mapSessionIdsTokens.put(sessionId, new ConcurrentHashMap<>());
this.mapSessionIdsTokens.get(sessionId).put(token, OpenViduRole.PUBLISHER);
this.mapSessionIdsTokens.get(sessionId).put(token, role);
// Add all the needed attributes to the template
model.addAttribute("sessionId", sessionId);
@ -326,7 +326,7 @@ if (this.mapSessions.get(sessionName) != null) {
String token = this.mapSessions.get(sessionName).generateToken(tokenOptions);
// Update our collection storing the new token
this.mapSessionIdsTokens.get(sessionId).put(token, OpenViduRole.PUBLISHER);
this.mapSessionIdsTokens.get(sessionId).put(token, role);
// Add all the needed attributes to the template
model.addAttribute("sessionId", sessionId);

View File

@ -56,7 +56,7 @@ public class SessionController {
String sessionId = this.mapSessions.get(sessionName).getSessionId();
String token = this.mapSessions.get(sessionName).generateToken(tokenOptions);
this.mapSessionIdsTokens.get(sessionId).put(token, OpenViduRole.PUBLISHER);
this.mapSessionIdsTokens.get(sessionId).put(token, role);
model.addAttribute("sessionId", sessionId);
model.addAttribute("token", token);
@ -80,7 +80,7 @@ public class SessionController {
this.mapSessions.put(sessionName, session);
this.mapSessionIdsTokens.put(sessionId, new ConcurrentHashMap<>());
this.mapSessionIdsTokens.get(sessionId).put(token, OpenViduRole.PUBLISHER);
this.mapSessionIdsTokens.get(sessionId).put(token, role);
model.addAttribute("sessionId", sessionId);
model.addAttribute("token", token);

View File

@ -121,8 +121,8 @@ function dashboardController(req, res) {
if (login(user, pass)) { // Correct user-pass
// Validate session and return OK
// Value stored in req.session allows us to identify the user in future requests
req.session.loggedUser = user;
// Value stored in req.session allows us to identify the user in future requests
req.session.loggedUser = user;
res.render('dashboard.ejs', {
user: user
});