From afd9b0ff437f5c51e428d8ab949311014e9a1c42 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Thu, 23 May 2024 15:17:23 +0530 Subject: [PATCH] removes unnecessary commented code in auth-react server --- test/auth-react-server/main.go | 233 --------------------------------- 1 file changed, 233 deletions(-) diff --git a/test/auth-react-server/main.go b/test/auth-react-server/main.go index 60139127..531ae598 100644 --- a/test/auth-react-server/main.go +++ b/test/auth-react-server/main.go @@ -326,134 +326,6 @@ func callSTInit(passwordlessConfig *plessmodels.TypeInput) { }, }, }), - // thirdpartyemailpassword.Init(&tpepmodels.TypeInput{ - // EmailDelivery: &emaildelivery.TypeInput{ - // Service: &emaildelivery.EmailDeliveryInterface{ - // SendEmail: &sendPasswordResetEmail, - // }, - // }, - // Override: &tpepmodels.OverrideStruct{ - // APIs: func(originalImplementation tpepmodels.APIInterface) tpepmodels.APIInterface { - // ogPasswordResetPOST := *originalImplementation.PasswordResetPOST - // ogGeneratePasswordResetTokenPOST := *originalImplementation.GeneratePasswordResetTokenPOST - // ogEmailExistsGET := *originalImplementation.EmailPasswordEmailExistsGET - // ogSignUpPOST := *originalImplementation.EmailPasswordSignUpPOST - // ogSignInPOST := *originalImplementation.EmailPasswordSignInPOST - // ogAuthorisationUrlGET := *originalImplementation.AuthorisationUrlGET - // ogSignInUpPOST := *originalImplementation.ThirdPartySignInUpPOST - - // (*originalImplementation.AuthorisationUrlGET) = func(provider *tpmodels.TypeProvider, redirectURIOnProviderDashboard string, tenantId string, options tpmodels.APIOptions, userContext supertokens.UserContext) (tpmodels.AuthorisationUrlGETResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API authorisation url get", true) - // if gr != nil { - // return tpmodels.AuthorisationUrlGETResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogAuthorisationUrlGET(provider, redirectURIOnProviderDashboard, tenantId, options, userContext) - // } - - // (*originalImplementation.ThirdPartySignInUpPOST) = func(provider *tpmodels.TypeProvider, input tpmodels.TypeSignInUpInput, tenantId string, options tpmodels.APIOptions, userContext supertokens.UserContext) (tpepmodels.ThirdPartySignInUpPOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API sign in up", false) - // if gr != nil { - // return tpepmodels.ThirdPartySignInUpPOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogSignInUpPOST(provider, input, tenantId, options, userContext) - // } - - // (*originalImplementation.PasswordResetPOST) = func(formFields []epmodels.TypeFormField, token string, tenantId string, options epmodels.APIOptions, userContext supertokens.UserContext) (epmodels.ResetPasswordPOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API reset password consume", false) - // if gr != nil { - // return epmodels.ResetPasswordPOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogPasswordResetPOST(formFields, token, tenantId, options, userContext) - // } - - // (*originalImplementation.GeneratePasswordResetTokenPOST) = func(formFields []epmodels.TypeFormField, tenantId string, options epmodels.APIOptions, userContext supertokens.UserContext) (epmodels.GeneratePasswordResetTokenPOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API reset password", false) - // if gr != nil { - // return epmodels.GeneratePasswordResetTokenPOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogGeneratePasswordResetTokenPOST(formFields, tenantId, options, userContext) - // } - - // (*originalImplementation.EmailPasswordEmailExistsGET) = func(email string, tenantId string, options epmodels.APIOptions, userContext supertokens.UserContext) (epmodels.EmailExistsGETResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API email exists", true) - // if gr != nil { - // return epmodels.EmailExistsGETResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogEmailExistsGET(email, tenantId, options, userContext) - // } - - // (*originalImplementation.EmailPasswordSignUpPOST) = func(formFields []epmodels.TypeFormField, tenantId string, options epmodels.APIOptions, userContext supertokens.UserContext) (tpepmodels.SignUpPOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API sign up", false) - // if gr != nil { - // return tpepmodels.SignUpPOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogSignUpPOST(formFields, tenantId, options, userContext) - // } - - // (*originalImplementation.EmailPasswordSignInPOST) = func(formFields []epmodels.TypeFormField, tenantId string, options epmodels.APIOptions, userContext supertokens.UserContext) (tpepmodels.SignInPOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API sign in", false) - // if gr != nil { - // return tpepmodels.SignInPOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogSignInPOST(formFields, tenantId, options, userContext) - // } - // return originalImplementation - // }, - // }, - // SignUpFeature: &epmodels.TypeInputSignUp{ - // FormFields: formFields, - // }, - // Providers: []tpmodels.ProviderInput{ - // { - // Config: tpmodels.ProviderConfig{ - // ThirdPartyId: "google", - // Clients: []tpmodels.ProviderClientConfig{ - // { - // ClientID: os.Getenv("GOOGLE_CLIENT_ID"), - // ClientSecret: os.Getenv("GOOGLE_CLIENT_SECRET"), - // }, - // }, - // }, - // }, - // { - // Config: tpmodels.ProviderConfig{ - // ThirdPartyId: "github", - // Clients: []tpmodels.ProviderClientConfig{ - // { - // ClientID: os.Getenv("GITHUB_CLIENT_ID"), - // ClientSecret: os.Getenv("GITHUB_CLIENT_SECRET"), - // }, - // }, - // }, - // }, - // { - // Config: tpmodels.ProviderConfig{ - // ThirdPartyId: "facebook", - // Clients: []tpmodels.ProviderClientConfig{ - // { - // ClientID: os.Getenv("FACEBOOK_CLIENT_ID"), - // ClientSecret: os.Getenv("FACEBOOK_CLIENT_SECRET"), - // }, - // }, - // }, - // }, - // customAuth0Provider(), - // }, - // }), session.Init(&sessmodels.TypeInput{ Override: &sessmodels.OverrideStruct{ APIs: func(originalImplementation sessmodels.APIInterface) sessmodels.APIInterface { @@ -527,111 +399,6 @@ func callSTInit(passwordlessConfig *plessmodels.TypeInput) { }, }, }), - // thirdpartypasswordless.Init(tplmodels.TypeInput{ - // ContactMethodPhone: passwordlessConfig.ContactMethodPhone, - // ContactMethodEmail: passwordlessConfig.ContactMethodEmail, - // ContactMethodEmailOrPhone: passwordlessConfig.ContactMethodEmailOrPhone, - // FlowType: passwordlessConfig.FlowType, - // GetCustomUserInputCode: passwordlessConfig.GetCustomUserInputCode, - // EmailDelivery: passwordlessConfig.EmailDelivery, - // SmsDelivery: passwordlessConfig.SmsDelivery, - // Providers: []tpmodels.ProviderInput{ - // { - // Config: tpmodels.ProviderConfig{ - // ThirdPartyId: "google", - // Clients: []tpmodels.ProviderClientConfig{ - // { - // ClientID: os.Getenv("GOOGLE_CLIENT_ID"), - // ClientSecret: os.Getenv("GOOGLE_CLIENT_SECRET"), - // }, - // }, - // }, - // }, - // { - // Config: tpmodels.ProviderConfig{ - // ThirdPartyId: "github", - // Clients: []tpmodels.ProviderClientConfig{ - // { - // ClientID: os.Getenv("GITHUB_CLIENT_ID"), - // ClientSecret: os.Getenv("GITHUB_CLIENT_SECRET"), - // }, - // }, - // }, - // }, - // { - // Config: tpmodels.ProviderConfig{ - // ThirdPartyId: "facebook", - // Clients: []tpmodels.ProviderClientConfig{ - // { - // ClientID: os.Getenv("FACEBOOK_CLIENT_ID"), - // ClientSecret: os.Getenv("FACEBOOK_CLIENT_SECRET"), - // }, - // }, - // }, - // }, - // customAuth0Provider(), - // }, - // Override: &tplmodels.OverrideStruct{ - // APIs: func(originalImplementation tplmodels.APIInterface) tplmodels.APIInterface { - // ogConsumeCodePOST := *originalImplementation.ConsumeCodePOST - // ogCreateCodePOST := *originalImplementation.CreateCodePOST - // ogResendCodePOST := *originalImplementation.ResendCodePOST - // ogAuthorisationUrlGET := *originalImplementation.AuthorisationUrlGET - // ogSignInUpPOST := *originalImplementation.ThirdPartySignInUpPOST - - // (*originalImplementation.AuthorisationUrlGET) = func(provider *tpmodels.TypeProvider, redirectURIOnProviderDashboard string, tenantId string, options tpmodels.APIOptions, userContext supertokens.UserContext) (tpmodels.AuthorisationUrlGETResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API authorisation url get", true) - // if gr != nil { - // return tpmodels.AuthorisationUrlGETResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogAuthorisationUrlGET(provider, redirectURIOnProviderDashboard, tenantId, options, userContext) - // } - - // (*originalImplementation.ThirdPartySignInUpPOST) = func(provider *tpmodels.TypeProvider, input tpmodels.TypeSignInUpInput, tenantId string, options tpmodels.APIOptions, userContext supertokens.UserContext) (tplmodels.ThirdPartySignInUpPOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API sign in up", false) - // if gr != nil { - // return tplmodels.ThirdPartySignInUpPOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogSignInUpPOST(provider, input, tenantId, options, userContext) - // } - - // (*originalImplementation.ConsumeCodePOST) = func(userInput *plessmodels.UserInputCodeWithDeviceID, linkCode *string, preAuthSessionID string, tenantId string, options plessmodels.APIOptions, userContext supertokens.UserContext) (tplmodels.ConsumeCodePOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API consume code", false) - // if gr != nil { - // return tplmodels.ConsumeCodePOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogConsumeCodePOST(userInput, linkCode, preAuthSessionID, tenantId, options, userContext) - // } - - // (*originalImplementation.CreateCodePOST) = func(email, phoneNumber *string, tenantId string, options plessmodels.APIOptions, userContext supertokens.UserContext) (plessmodels.CreateCodePOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API create code", false) - // if gr != nil { - // return plessmodels.CreateCodePOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogCreateCodePOST(email, phoneNumber, tenantId, options, userContext) - // } - - // (*originalImplementation.ResendCodePOST) = func(deviceID, preAuthSessionID string, tenantId string, options plessmodels.APIOptions, userContext supertokens.UserContext) (plessmodels.ResendCodePOSTResponse, error) { - // gr := returnGeneralErrorIfNeeded(*options.Req, "general error from API resend code", false) - // if gr != nil { - // return plessmodels.ResendCodePOSTResponse{ - // GeneralError: gr, - // }, nil - // } - // return ogResendCodePOST(deviceID, preAuthSessionID, tenantId, options, userContext) - // } - // return originalImplementation - // }, - // }, - // }), userroles.Init(nil), }, })