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
cfd8eb51
Unverified
Commit
cfd8eb51
authored
Feb 04, 2019
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now /api/login/ping returns Response
parent
bd830780
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
pkg/api/api.go
+2
-2
pkg/api/login.go
+4
-5
No files found.
pkg/api/api.go
View file @
cfd8eb51
...
...
@@ -108,8 +108,8 @@ func (hs *HTTPServer) registerRoutes() {
r
.
Get
(
"/api/snapshots-delete/:deleteKey"
,
Wrap
(
DeleteDashboardSnapshotByDeleteKey
))
r
.
Delete
(
"/api/snapshots/:key"
,
reqEditorRole
,
Wrap
(
DeleteDashboardSnapshot
))
// api renew session based on
remember
cookie
r
.
Get
(
"/api/login/ping"
,
quota
(
"session"
),
hs
.
LoginAPIPing
)
// api renew session based on cookie
r
.
Get
(
"/api/login/ping"
,
quota
(
"session"
),
Wrap
(
hs
.
LoginAPIPing
)
)
// authed api
r
.
Group
(
"/api"
,
func
(
apiRoute
routing
.
RouteRegister
)
{
...
...
pkg/api/login.go
View file @
cfd8eb51
...
...
@@ -78,13 +78,12 @@ func tryOAuthAutoLogin(c *m.ReqContext) bool {
return
false
}
func
(
hs
*
HTTPServer
)
LoginAPIPing
(
c
*
m
.
ReqContext
)
{
if
c
.
IsSignedIn
||
(
c
.
AllowAnonymous
&&
c
.
IsAnonymous
)
{
c
.
JsonOK
(
"Logged in"
)
return
func
(
hs
*
HTTPServer
)
LoginAPIPing
(
c
*
m
.
ReqContext
)
Response
{
if
c
.
IsSignedIn
||
c
.
IsAnonymous
{
return
JSON
(
200
,
"Logged in"
)
}
c
.
JsonApiEr
r
(
401
,
"Unauthorized"
,
nil
)
return
Erro
r
(
401
,
"Unauthorized"
,
nil
)
}
func
(
hs
*
HTTPServer
)
LoginPost
(
c
*
m
.
ReqContext
,
cmd
dtos
.
LoginCommand
)
Response
{
...
...
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