Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overrides doesn't work if not overriden inplace #162

Open
sattvikc opened this issue Aug 8, 2022 · 1 comment
Open

Overrides doesn't work if not overriden inplace #162

sattvikc opened this issue Aug 8, 2022 · 1 comment

Comments

@sattvikc
Copy link
Collaborator

sattvikc commented Aug 8, 2022

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
		},
	},
})
@mkrou
Copy link

mkrou commented Feb 14, 2024

I encountered the same problem when override signInUp function. @sattvikc Did you manage to solve the problem somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants