Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
41349185
Commit
41349185
authored
Jul 11, 2019
by
Roger
Committed by
Francesc Guasch
Jul 11, 2019
Browse files
feature(frontend): disable timeout check in login form (#1110)
fixes issue #1102
parent
4fd098fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
rvd_front.pl
View file @
41349185
...
...
@@ -1245,26 +1245,14 @@ sub login {
my
$login
=
$c
->
param
('
login
');
my
$password
=
$c
->
param
('
password
');
my
$form_hash
=
$c
->
param
('
login_hash
');
my
$url
=
(
$c
->
param
('
url
')
or
$c
->
req
->
url
->
to_abs
->
path
);
$url
=
'
/
'
if
$url
=~
m{^/login}
;
my
@error
=
();
# TODO: improve this hash
my
(
$time
)
=
time
=~
m{(.*)...$}
;
my
$login_hash1
=
$time
.
(
$CONFIG_FRONT
->
{
secrets
}
->
[
0
]
or
'');
# let login varm be valid for 60 seconds
(
$time
)
=
(
time
-
60
)
=~
m{(.*)...$}
;
my
$login_hash2
=
$time
.
(
$CONFIG_FRONT
->
{
secrets
}
->
[
0
]
or
'');
if
(
defined
$login
||
defined
$password
||
$c
->
param
('
submit
'))
{
push
@error
,("
Empty login name
")
if
!
length
$login
;
push
@error
,("
Empty password
")
if
!
length
$password
;
push
@error
,("
Session timeout
")
if
$form_hash
ne
sha256_hex
(
$login_hash1
)
&&
$form_hash
ne
sha256_hex
(
$login_hash2
);
}
if
(
!
@error
&&
defined
$login
&&
defined
$password
)
{
...
...
@@ -1304,7 +1292,6 @@ sub login {
,
js
=>
['
/js/main.js
']
,
navbar_custom
=>
1
,
login
=>
$login
,
login_hash
=>
sha256_hex
(
$login_hash1
)
,
error
=>
\
@error
,
login_header
=>
$CONFIG_FRONT
->
{
login_header
}
,
login_message
=>
$CONFIG_FRONT
->
{
login_message
}
...
...
templates/main/start.html.ep
View file @
41349185
...
...
@@ -14,8 +14,6 @@
<input
class=
"form-control"
id=
"pssw"
type=
"password"
name=
"password"
value=
""
placeholder=
"<%=l 'Password' %>"
required
>
<input
type=
"hidden"
name=
"url"
value=
"<%= $url %>"
>
<input
type=
"hidden"
name=
"login_hash"
value=
"<%= $login_hash %>"
>
<!-- <input type="submit" name="submit" value="launch"> -->
<button
id=
"submit"
class=
"btn btn-success btn-lg btn-block"
href=
"/"
type=
"submit"
name=
"submit"
value=
"launch"
><
%=
l
'
Login
'
%
></button>
% if (scalar @$error) {
...
...
Write
Preview
Supports
Markdown
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