Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
b780415f
Commit
b780415f
authored
Apr 25, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: change to remember me cookie encoding
parent
aee4af21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
pkg/api/login.go
+2
-4
No files found.
pkg/api/login.go
View file @
b780415f
...
...
@@ -11,7 +11,6 @@ import (
"github.com/grafana/grafana/pkg/middleware"
m
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
)
const
(
...
...
@@ -79,8 +78,7 @@ func tryLoginUsingRememberCookie(c *middleware.Context) bool {
user
:=
userQuery
.
Result
// validate remember me cookie
if
val
,
_
:=
c
.
GetSuperSecureCookie
(
util
.
EncodeMd5
(
user
.
Rands
+
user
.
Password
),
setting
.
CookieRememberName
);
val
!=
user
.
Login
{
if
val
,
_
:=
c
.
GetSuperSecureCookie
(
user
.
Rands
+
user
.
Password
,
setting
.
CookieRememberName
);
val
!=
user
.
Login
{
return
false
}
...
...
@@ -142,7 +140,7 @@ func loginUserWithUser(user *m.User, c *middleware.Context) {
days
:=
86400
*
setting
.
LogInRememberDays
if
days
>
0
{
c
.
SetCookie
(
setting
.
CookieUserName
,
user
.
Login
,
days
,
setting
.
AppSubUrl
+
"/"
)
c
.
SetSuperSecureCookie
(
u
til
.
EncodeMd5
(
user
.
Rands
+
user
.
Password
)
,
setting
.
CookieRememberName
,
user
.
Login
,
days
,
setting
.
AppSubUrl
+
"/"
)
c
.
SetSuperSecureCookie
(
u
ser
.
Rands
+
user
.
Password
,
setting
.
CookieRememberName
,
user
.
Login
,
days
,
setting
.
AppSubUrl
+
"/"
)
}
c
.
Session
.
Set
(
middleware
.
SESS_KEY_USERID
,
user
.
Id
)
...
...
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