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
a5e6cb9a
Commit
a5e6cb9a
authored
May 27, 2018
by
Julien Pivotto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #9847 Add a generic signout_redirect_url to enable oauth logout
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
parent
c40b0ea1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
0 deletions
+12
-0
conf/defaults.ini
+3
-0
conf/sample.ini
+3
-0
pkg/api/login.go
+4
-0
pkg/setting/setting.go
+2
-0
No files found.
conf/defaults.ini
View file @
a5e6cb9a
...
@@ -237,6 +237,9 @@ disable_login_form = false
...
@@ -237,6 +237,9 @@ disable_login_form = false
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy
disable_signout_menu
=
false
disable_signout_menu
=
false
# URL to redirect the user to after sign out
signout_redirect_url
=
#################################### Anonymous Auth ######################
#################################### Anonymous Auth ######################
[auth.anonymous]
[auth.anonymous]
# enable anonymous access
# enable anonymous access
...
...
conf/sample.ini
View file @
a5e6cb9a
...
@@ -217,6 +217,9 @@ log_queries =
...
@@ -217,6 +217,9 @@ log_queries =
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
;disable_signout_menu = false
;disable_signout_menu = false
# URL to redirect the user to after sign out
;signout_redirect_url =
#################################### Anonymous Auth ##########################
#################################### Anonymous Auth ##########################
[auth.anonymous]
[auth.anonymous]
# enable anonymous access
# enable anonymous access
...
...
pkg/api/login.go
View file @
a5e6cb9a
...
@@ -155,5 +155,9 @@ func Logout(c *m.ReqContext) {
...
@@ -155,5 +155,9 @@ func Logout(c *m.ReqContext) {
c
.
SetCookie
(
setting
.
CookieUserName
,
""
,
-
1
,
setting
.
AppSubUrl
+
"/"
)
c
.
SetCookie
(
setting
.
CookieUserName
,
""
,
-
1
,
setting
.
AppSubUrl
+
"/"
)
c
.
SetCookie
(
setting
.
CookieRememberName
,
""
,
-
1
,
setting
.
AppSubUrl
+
"/"
)
c
.
SetCookie
(
setting
.
CookieRememberName
,
""
,
-
1
,
setting
.
AppSubUrl
+
"/"
)
c
.
Session
.
Destory
(
c
.
Context
)
c
.
Session
.
Destory
(
c
.
Context
)
if
setting
.
SignoutRedirectUrl
!=
""
{
c
.
Redirect
(
setting
.
SignoutRedirectUrl
)
}
else
{
c
.
Redirect
(
setting
.
AppSubUrl
+
"/login"
)
c
.
Redirect
(
setting
.
AppSubUrl
+
"/login"
)
}
}
}
pkg/setting/setting.go
View file @
a5e6cb9a
...
@@ -104,6 +104,7 @@ var (
...
@@ -104,6 +104,7 @@ var (
DefaultTheme
string
DefaultTheme
string
DisableLoginForm
bool
DisableLoginForm
bool
DisableSignoutMenu
bool
DisableSignoutMenu
bool
SignoutRedirectUrl
string
ExternalUserMngLinkUrl
string
ExternalUserMngLinkUrl
string
ExternalUserMngLinkName
string
ExternalUserMngLinkName
string
ExternalUserMngInfo
string
ExternalUserMngInfo
string
...
@@ -601,6 +602,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
...
@@ -601,6 +602,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
auth
:=
iniFile
.
Section
(
"auth"
)
auth
:=
iniFile
.
Section
(
"auth"
)
DisableLoginForm
=
auth
.
Key
(
"disable_login_form"
)
.
MustBool
(
false
)
DisableLoginForm
=
auth
.
Key
(
"disable_login_form"
)
.
MustBool
(
false
)
DisableSignoutMenu
=
auth
.
Key
(
"disable_signout_menu"
)
.
MustBool
(
false
)
DisableSignoutMenu
=
auth
.
Key
(
"disable_signout_menu"
)
.
MustBool
(
false
)
SignoutRedirectUrl
=
auth
.
Key
(
"signout_redirect_url"
)
.
String
()
// anonymous access
// anonymous access
AnonymousEnabled
=
iniFile
.
Section
(
"auth.anonymous"
)
.
Key
(
"enabled"
)
.
MustBool
(
false
)
AnonymousEnabled
=
iniFile
.
Section
(
"auth.anonymous"
)
.
Key
(
"enabled"
)
.
MustBool
(
false
)
...
...
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