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
dbfaf5da
Commit
dbfaf5da
authored
Jan 23, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: minor refactoring of PR #10560
parent
a24aa3ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
pkg/api/login_oauth.go
+4
-5
pkg/social/social.go
+1
-1
No files found.
pkg/api/login_oauth.go
View file @
dbfaf5da
...
...
@@ -29,7 +29,7 @@ var (
ErrSignUpNotAllowed
=
errors
.
New
(
"Signup is not allowed for this adapter"
)
ErrUsersQuotaReached
=
errors
.
New
(
"Users quota reached"
)
ErrNoEmail
=
errors
.
New
(
"Login provider didn't return an email address"
)
oauthLogger
=
log
.
New
(
"oauth
.login
"
)
oauthLogger
=
log
.
New
(
"oauth"
)
)
func
GenStateString
()
string
{
...
...
@@ -96,7 +96,7 @@ func OAuthLogin(ctx *middleware.Context) {
if
setting
.
OAuthService
.
OAuthInfos
[
name
]
.
TlsClientCert
!=
""
||
setting
.
OAuthService
.
OAuthInfos
[
name
]
.
TlsClientKey
!=
""
{
cert
,
err
:=
tls
.
LoadX509KeyPair
(
setting
.
OAuthService
.
OAuthInfos
[
name
]
.
TlsClientCert
,
setting
.
OAuthService
.
OAuthInfos
[
name
]
.
TlsClientKey
)
if
err
!=
nil
{
oauthLogger
.
Error
(
"Failed to setup TlsClientCert"
,
"oauth provider
"
,
name
,
"error"
,
err
)
ctx
.
Logger
.
Error
(
"Failed to setup TlsClientCert"
,
"oauth
"
,
name
,
"error"
,
err
)
ctx
.
Handle
(
500
,
"login.OAuthLogin(Failed to setup TlsClientCert)"
,
nil
)
return
}
...
...
@@ -107,7 +107,7 @@ func OAuthLogin(ctx *middleware.Context) {
if
setting
.
OAuthService
.
OAuthInfos
[
name
]
.
TlsClientCa
!=
""
{
caCert
,
err
:=
ioutil
.
ReadFile
(
setting
.
OAuthService
.
OAuthInfos
[
name
]
.
TlsClientCa
)
if
err
!=
nil
{
oauthLogger
.
Error
(
"Failed to setup TlsClientCa"
,
"oauth provider
"
,
name
,
"error"
,
err
)
ctx
.
Logger
.
Error
(
"Failed to setup TlsClientCa"
,
"oauth
"
,
name
,
"error"
,
err
)
ctx
.
Handle
(
500
,
"login.OAuthLogin(Failed to setup TlsClientCa)"
,
nil
)
return
}
...
...
@@ -209,8 +209,7 @@ func OAuthLogin(ctx *middleware.Context) {
}
func
redirectWithError
(
ctx
*
middleware
.
Context
,
err
error
,
v
...
interface
{})
{
oauthLogger
.
Info
(
err
.
Error
(),
v
...
)
// TODO: we can use the flash storage here once it's implemented
ctx
.
Logger
.
Error
(
err
.
Error
(),
v
...
)
ctx
.
Session
.
Set
(
"loginError"
,
err
.
Error
())
ctx
.
Redirect
(
setting
.
AppSubUrl
+
"/login"
)
}
pkg/social/social.go
View file @
dbfaf5da
...
...
@@ -97,7 +97,7 @@ func NewOAuthService() {
Scopes
:
info
.
Scopes
,
}
logger
:=
log
.
New
(
"oauth.
login.
"
+
name
)
logger
:=
log
.
New
(
"oauth."
+
name
)
// GitHub.
if
name
==
"github"
{
...
...
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