New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Barbara/user info #1563
Barbara/user info #1563
Conversation
dd13cfd
to
3e29672
Compare
@@ -631,7 +631,8 @@ var ShinyApp = function() { | |||
}); | |||
|
|||
addMessageHandler('config', function(message) { | |||
this.config = message; | |||
this.config = {workerId: message.workerId, sessionId: message.sessionId}; | |||
if (message.user != null) exports.user = message.user; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!=
is on purpose (instead of !==
) because it checks for both null
and undefined
(see here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next time please make a comment directly in the code to that effect.
This exports
session$user
(if it exists) to the client-side. It's accessible in the Shiny object:Shiny.user