API: Add .well-known/oauth-authorization-server route handler #808 #3943

This commit also adds an /api/v1/oauth/logout endpoint that allows
clients to delete their sessions (access tokens) as needed.

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-01-08 14:53:39 +01:00
parent f8e0615cc8
commit 0e4d81853c
33 changed files with 555 additions and 183 deletions

View File

@@ -14,7 +14,7 @@ import (
//
// GET /api/v1/session/:id
func GetSession(router *gin.RouterGroup) {
router.GET("/session/:id", func(c *gin.Context) {
getSessionHandler := func(c *gin.Context) {
id := clean.ID(c.Param("id"))
// Check authentication token.
@@ -60,5 +60,7 @@ func GetSession(router *gin.RouterGroup) {
// Return JSON response.
c.JSON(http.StatusOK, response)
})
}
router.GET("/session/:id", getSessionHandler)
}