Skip to content
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

fix: right after loading windows.oc_user is stored in OC._user #41054

Merged
merged 1 commit into from Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/unreleased/41054
@@ -0,0 +1,7 @@
Bugfix: Store user information in explicit variable

Before user information was stored in the browser global object. In some rare
cases browsers seem to loose data stored in the global object. This is fixed now.

https://github.com/owncloud/core/pull/41054
https://github.com/owncloud/enterprise/issues/5873
4 changes: 3 additions & 1 deletion core/js/js.js
Expand Up @@ -74,6 +74,8 @@ var OC = {
*/
_capabilities: window.oc_capabilities || null,

_user: window.oc_user || null,

appswebroots: (typeof oc_appswebroots !== 'undefined') ? oc_appswebroots : false,
/**
* Currently logged in user or null if none
Expand Down Expand Up @@ -321,7 +323,7 @@ var OC = {
* @since 9.0.0
*/
getCurrentUser: function () {
if (!_.isUndefined(window.oc_user)) {
if (OC._user !== null) {
return oc_user;
}
return {
Expand Down