Files

16 lines
476 B
Go

package subsonic
func init() {
registerExtension("apiKeyAuthentication", 1)
register("tokenInfo", handleTokenInfo)
}
// handleTokenInfo confirms which user an API key (or any other
// credential) resolves to — primarily useful for a client that just
// received a key and wants to confirm it works before storing it.
func handleTokenInfo(rc *Context) *apiError {
rc.Response = newResponse()
rc.Response.TokenInfo = &TokenInfo{Username: rc.User.Username}
return nil
}