Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
517d7edb
Commit
517d7edb
authored
Sep 10, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make login work when sessionStorage is not available.
Thanks to Ralf Treinen for pointing out the issue.
parent
4bdd7c76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
static/sfu.js
static/sfu.js
+21
-8
No files found.
static/sfu.js
View file @
517d7edb
...
...
@@ -11,18 +11,31 @@ let group;
/** @type {ServerConnection} */
let
serverConnection
;
/* Some browsers disable session storage when cookies are disabled,
we fall back to a global variable. */
let
fallbackUserPass
=
null
;
function
setUserPass
(
username
,
password
)
{
window
.
sessionStorage
.
setItem
(
'
userpass
'
,
JSON
.
stringify
({
username
:
username
,
password
:
password
}),
);
let
userpass
=
{
username
:
username
,
password
:
password
};
try
{
window
.
sessionStorage
.
setItem
(
'
userpass
'
,
JSON
.
stringify
(
userpass
));
fallbackUserPass
=
null
;
}
catch
(
e
)
{
console
.
warn
(
"
Couldn't store password:
"
,
e
);
fallbackUserPass
=
{
username
:
username
,
password
:
password
};
}
}
function
getUserPass
()
{
let
userpass
=
window
.
sessionStorage
.
getItem
(
'
userpass
'
);
if
(
!
userpass
)
return
null
;
return
JSON
.
parse
(
userpass
);
let
userpass
;
try
{
let
json
=
window
.
sessionStorage
.
getItem
(
'
userpass
'
);
userpass
=
JSON
.
parse
(
json
);
}
catch
(
e
)
{
console
.
warn
(
"
Couldn't retrieve password:
"
,
e
);
userpass
=
fallbackUserPass
;
}
return
userpass
||
null
;
}
function
getUsername
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment