fix: memory store upgrade in token helpers

This commit is contained in:
Lakhan Samani
2022-05-30 11:00:00 +05:30
parent 268b22ffb2
commit 1146468a03
4 changed files with 122 additions and 30 deletions

View File

@@ -10,9 +10,13 @@ import (
// CreateVerificationToken creates a verification JWT token
func CreateVerificationToken(email, tokenType, hostname, nonceHash, redirectURL string) (string, error) {
clientID, err := memorystore.Provider.GetStringStoreEnvVariable(constants.EnvKeyClientID)
if err != nil {
return "", err
}
claims := jwt.MapClaims{
"iss": hostname,
"aud": memorystore.Provider.GetStringStoreEnvVariable(constants.EnvKeyClientID),
"aud": clientID,
"sub": email,
"exp": time.Now().Add(time.Minute * 30).Unix(),
"iat": time.Now().Unix(),