1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

set defaults for request context

This commit is contained in:
Harvey Kandola 2017-08-27 16:39:09 +01:00
parent 63b24aed3f
commit 8081b60146
23 changed files with 692 additions and 666 deletions

View file

@ -25,16 +25,19 @@ import (
)
func clientID(ctx domain.RequestContext, s *domain.Store) string {
return s.Setting.Get(meta.ConfigHandle(), "clientID")
c, _ := s.Setting.Get(meta.ConfigHandle(), "clientID")
return c
}
func clientSecret(ctx domain.RequestContext, s *domain.Store) string {
return s.Setting.Get(meta.ConfigHandle(), "clientSecret")
c, _ := s.Setting.Get(meta.ConfigHandle(), "clientSecret")
return c
}
func authorizationCallbackURL(ctx domain.RequestContext, s *domain.Store) string {
// NOTE: URL value must have the path and query "/api/public/validate?section=github"
return s.Setting.Get(meta.ConfigHandle(), "authorizationCallbackURL")
c, _ := s.Setting.Get(meta.ConfigHandle(), "authorizationCallbackURL")
return c
}
func validateToken(ctx provider.Context, s *domain.Store, ptoken string) error {