1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 12:05:23 +02:00

pointers to Runtime!

This commit is contained in:
Harvey Kandola 2017-07-24 19:10:49 +01:00
parent 792c3e2ce8
commit 27640dffc4
15 changed files with 315 additions and 82 deletions

View file

@ -23,7 +23,7 @@ import (
)
// GenerateJWT generates JSON Web Token (http://jwt.io)
func GenerateJWT(rt env.Runtime, user, org, domain string) string {
func GenerateJWT(rt *env.Runtime, user, org, domain string) string {
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
"iss": "Documize",
"sub": "webapp",
@ -61,7 +61,7 @@ func FindJWT(r *http.Request) (token string) {
}
// DecodeJWT decodes raw token.
func DecodeJWT(rt env.Runtime, tokenString string) (c domain.RequestContext, claims jwt.Claims, err error) {
func DecodeJWT(rt *env.Runtime, tokenString string) (c domain.RequestContext, claims jwt.Claims, err error) {
// sensible defaults
c.UserID = ""
c.OrgID = ""