diff --git a/packaging/publish/publish_both.sh b/packaging/publish/publish_both.sh index f4bf299a612..7f38eb5a155 100755 --- a/packaging/publish/publish_both.sh +++ b/packaging/publish/publish_both.sh @@ -18,3 +18,5 @@ package_cloud push grafana/testing/el/7 grafana-${version}-1.x86_64.rpm package_cloud push grafana/stable/el/7 grafana-${version}-1.x86_64.rpm package_cloud push grafana/stable/el/6 grafana-${version}-1.x86_64.rpm + +rm grafana*.{deb,rpm} diff --git a/packaging/publish/publish_testing.sh b/packaging/publish/publish_testing.sh index bf109c96420..0bf62a83040 100755 --- a/packaging/publish/publish_testing.sh +++ b/packaging/publish/publish_testing.sh @@ -13,3 +13,4 @@ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${rpm_v package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm +rm grafana*.{deb,rpm} diff --git a/pkg/api/login.go b/pkg/api/login.go index baec5f5f6c0..a9fcbee8e8e 100644 --- a/pkg/api/login.go +++ b/pkg/api/login.go @@ -143,6 +143,7 @@ func loginUserWithUser(user *m.User, c *middleware.Context) { c.SetSuperSecureCookie(user.Rands+user.Password, setting.CookieRememberName, user.Login, days, setting.AppSubUrl+"/") } + c.Session.RegenerateId(c) c.Session.Set(middleware.SESS_KEY_USERID, user.Id) } diff --git a/pkg/middleware/auth_proxy_test.go b/pkg/middleware/auth_proxy_test.go index bd587bc0c7f..4da0f52bbcf 100644 --- a/pkg/middleware/auth_proxy_test.go +++ b/pkg/middleware/auth_proxy_test.go @@ -106,6 +106,10 @@ func (s *mockSession) Destory(c *Context) error { return nil } +func (s *mockSession) RegenerateId(c *Context) error { + return nil +} + type mockLdapAuthenticator struct { syncSignedInUserCalled bool } diff --git a/pkg/middleware/session.go b/pkg/middleware/session.go index a6af63d18de..4de111ff3d2 100644 --- a/pkg/middleware/session.go +++ b/pkg/middleware/session.go @@ -103,6 +103,8 @@ type SessionStore interface { Destory(*Context) error // init Start(*Context) error + // RegenerateId regenerates the session id + RegenerateId(*Context) error } type SessionWrapper struct { @@ -116,6 +118,12 @@ func (s *SessionWrapper) Start(c *Context) error { return err } +func (s *SessionWrapper) RegenerateId(c *Context) error { + var err error + s.session, err = s.manager.RegenerateId(c.Context) + return err +} + func (s *SessionWrapper) Set(k interface{}, v interface{}) error { if s.session != nil { return s.session.Set(k, v) diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index 46d108b43df..f03ca8c8003 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -214,12 +214,8 @@ export class KeybindingSrv { if (popups.length > 0) { return; } - // close modals - var modalData = $(".modal").data(); - if (modalData && modalData.$scope && modalData.$scope.dismiss) { - modalData.$scope.dismiss(); - } + scope.appEvent('hide-modal'); scope.appEvent('hide-dash-editor'); scope.appEvent('panel-change-view', {fullscreen: false, edit: false}); });