supertokens-golang
supertokens-golang copied to clipboard
Overrides doesn't work if not overriden inplace
For example
session.Init(&sessmodels.TypeInput{
AntiCsrf: &customAntiCsrfVal,
Override: &sessmodels.OverrideStruct{
Functions: func(originalImplementation sessmodels.RecipeInterface) sessmodels.RecipeInterface {
oGetSessionInformation := *originalImplementation.GetSessionInformation
nGetSessionInformation := func(sessionHandle string, userContext supertokens.UserContext) (*sessmodels.SessionInformation, error) {
info, err := oGetSessionInformation(sessionHandle, userContext)
if err != nil {
return nil, err
}
info.SessionData = map[string]interface{}{
"test": 1,
}
return info, nil
}
originalImplementation.GetSessionInformation = &nGetSessionInformation
return originalImplementation
},
},
})
I encountered the same problem when override signInUp function. @sattvikc Did you manage to solve the problem somehow?