fix: forgot password shown with magic link login
This commit is contained in:
parent
bea6eb8342
commit
f70310f04f
|
@ -172,7 +172,9 @@ type ComplexityRoot struct {
|
||||||
IsLinkedinLoginEnabled func(childComplexity int) int
|
IsLinkedinLoginEnabled func(childComplexity int) int
|
||||||
IsMagicLinkLoginEnabled func(childComplexity int) int
|
IsMagicLinkLoginEnabled func(childComplexity int) int
|
||||||
IsMicrosoftLoginEnabled func(childComplexity int) int
|
IsMicrosoftLoginEnabled func(childComplexity int) int
|
||||||
|
IsMobileBasicAuthenticationEnabled func(childComplexity int) int
|
||||||
IsMultiFactorAuthEnabled func(childComplexity int) int
|
IsMultiFactorAuthEnabled func(childComplexity int) int
|
||||||
|
IsPhoneVerificationEnabled func(childComplexity int) int
|
||||||
IsSignUpEnabled func(childComplexity int) int
|
IsSignUpEnabled func(childComplexity int) int
|
||||||
IsStrongPasswordEnabled func(childComplexity int) int
|
IsStrongPasswordEnabled func(childComplexity int) int
|
||||||
IsTwitchLoginEnabled func(childComplexity int) int
|
IsTwitchLoginEnabled func(childComplexity int) int
|
||||||
|
@ -1142,6 +1144,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||||
|
|
||||||
return e.complexity.Meta.IsMicrosoftLoginEnabled(childComplexity), true
|
return e.complexity.Meta.IsMicrosoftLoginEnabled(childComplexity), true
|
||||||
|
|
||||||
|
case "Meta.is_mobile_basic_authentication_enabled":
|
||||||
|
if e.complexity.Meta.IsMobileBasicAuthenticationEnabled == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.Meta.IsMobileBasicAuthenticationEnabled(childComplexity), true
|
||||||
|
|
||||||
case "Meta.is_multi_factor_auth_enabled":
|
case "Meta.is_multi_factor_auth_enabled":
|
||||||
if e.complexity.Meta.IsMultiFactorAuthEnabled == nil {
|
if e.complexity.Meta.IsMultiFactorAuthEnabled == nil {
|
||||||
break
|
break
|
||||||
|
@ -1149,6 +1158,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||||
|
|
||||||
return e.complexity.Meta.IsMultiFactorAuthEnabled(childComplexity), true
|
return e.complexity.Meta.IsMultiFactorAuthEnabled(childComplexity), true
|
||||||
|
|
||||||
|
case "Meta.is_phone_verification_enabled":
|
||||||
|
if e.complexity.Meta.IsPhoneVerificationEnabled == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.Meta.IsPhoneVerificationEnabled(childComplexity), true
|
||||||
|
|
||||||
case "Meta.is_sign_up_enabled":
|
case "Meta.is_sign_up_enabled":
|
||||||
if e.complexity.Meta.IsSignUpEnabled == nil {
|
if e.complexity.Meta.IsSignUpEnabled == nil {
|
||||||
break
|
break
|
||||||
|
@ -2355,6 +2371,8 @@ type Meta {
|
||||||
is_sign_up_enabled: Boolean!
|
is_sign_up_enabled: Boolean!
|
||||||
is_strong_password_enabled: Boolean!
|
is_strong_password_enabled: Boolean!
|
||||||
is_multi_factor_auth_enabled: Boolean!
|
is_multi_factor_auth_enabled: Boolean!
|
||||||
|
is_mobile_basic_authentication_enabled: Boolean!
|
||||||
|
is_phone_verification_enabled: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
type User {
|
type User {
|
||||||
|
@ -8373,6 +8391,94 @@ func (ec *executionContext) fieldContext_Meta_is_multi_factor_auth_enabled(ctx c
|
||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _Meta_is_mobile_basic_authentication_enabled(ctx context.Context, field graphql.CollectedField, obj *model.Meta) (ret graphql.Marshaler) {
|
||||||
|
fc, err := ec.fieldContext_Meta_is_mobile_basic_authentication_enabled(ctx, field)
|
||||||
|
if err != nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
ec.Error(ctx, ec.Recover(ctx, r))
|
||||||
|
ret = graphql.Null
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return obj.IsMobileBasicAuthenticationEnabled, nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
if resTmp == nil {
|
||||||
|
if !graphql.HasFieldError(ctx, fc) {
|
||||||
|
ec.Errorf(ctx, "must not be null")
|
||||||
|
}
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(bool)
|
||||||
|
fc.Result = res
|
||||||
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_Meta_is_mobile_basic_authentication_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "Meta",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
return nil, errors.New("field of type Boolean does not have child fields")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _Meta_is_phone_verification_enabled(ctx context.Context, field graphql.CollectedField, obj *model.Meta) (ret graphql.Marshaler) {
|
||||||
|
fc, err := ec.fieldContext_Meta_is_phone_verification_enabled(ctx, field)
|
||||||
|
if err != nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
ec.Error(ctx, ec.Recover(ctx, r))
|
||||||
|
ret = graphql.Null
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return obj.IsPhoneVerificationEnabled, nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
if resTmp == nil {
|
||||||
|
if !graphql.HasFieldError(ctx, fc) {
|
||||||
|
ec.Errorf(ctx, "must not be null")
|
||||||
|
}
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(bool)
|
||||||
|
fc.Result = res
|
||||||
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_Meta_is_phone_verification_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "Meta",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
return nil, errors.New("field of type Boolean does not have child fields")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _Mutation_signup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
func (ec *executionContext) _Mutation_signup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||||
fc, err := ec.fieldContext_Mutation_signup(ctx, field)
|
fc, err := ec.fieldContext_Mutation_signup(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -10653,6 +10759,10 @@ func (ec *executionContext) fieldContext_Query_meta(ctx context.Context, field g
|
||||||
return ec.fieldContext_Meta_is_strong_password_enabled(ctx, field)
|
return ec.fieldContext_Meta_is_strong_password_enabled(ctx, field)
|
||||||
case "is_multi_factor_auth_enabled":
|
case "is_multi_factor_auth_enabled":
|
||||||
return ec.fieldContext_Meta_is_multi_factor_auth_enabled(ctx, field)
|
return ec.fieldContext_Meta_is_multi_factor_auth_enabled(ctx, field)
|
||||||
|
case "is_mobile_basic_authentication_enabled":
|
||||||
|
return ec.fieldContext_Meta_is_mobile_basic_authentication_enabled(ctx, field)
|
||||||
|
case "is_phone_verification_enabled":
|
||||||
|
return ec.fieldContext_Meta_is_phone_verification_enabled(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type Meta", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type Meta", field.Name)
|
||||||
},
|
},
|
||||||
|
@ -19594,6 +19704,16 @@ func (ec *executionContext) _Meta(ctx context.Context, sel ast.SelectionSet, obj
|
||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
out.Invalids++
|
out.Invalids++
|
||||||
}
|
}
|
||||||
|
case "is_mobile_basic_authentication_enabled":
|
||||||
|
out.Values[i] = ec._Meta_is_mobile_basic_authentication_enabled(ctx, field, obj)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
out.Invalids++
|
||||||
|
}
|
||||||
|
case "is_phone_verification_enabled":
|
||||||
|
out.Values[i] = ec._Meta_is_phone_verification_enabled(ctx, field, obj)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
out.Invalids++
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
panic("unknown field " + strconv.Quote(field.Name))
|
panic("unknown field " + strconv.Quote(field.Name))
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,6 +207,8 @@ type Meta struct {
|
||||||
IsSignUpEnabled bool `json:"is_sign_up_enabled"`
|
IsSignUpEnabled bool `json:"is_sign_up_enabled"`
|
||||||
IsStrongPasswordEnabled bool `json:"is_strong_password_enabled"`
|
IsStrongPasswordEnabled bool `json:"is_strong_password_enabled"`
|
||||||
IsMultiFactorAuthEnabled bool `json:"is_multi_factor_auth_enabled"`
|
IsMultiFactorAuthEnabled bool `json:"is_multi_factor_auth_enabled"`
|
||||||
|
IsMobileBasicAuthenticationEnabled bool `json:"is_mobile_basic_authentication_enabled"`
|
||||||
|
IsPhoneVerificationEnabled bool `json:"is_phone_verification_enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MobileLoginInput struct {
|
type MobileLoginInput struct {
|
||||||
|
|
|
@ -29,6 +29,8 @@ type Meta {
|
||||||
is_sign_up_enabled: Boolean!
|
is_sign_up_enabled: Boolean!
|
||||||
is_strong_password_enabled: Boolean!
|
is_strong_password_enabled: Boolean!
|
||||||
is_multi_factor_auth_enabled: Boolean!
|
is_multi_factor_auth_enabled: Boolean!
|
||||||
|
is_mobile_basic_authentication_enabled: Boolean!
|
||||||
|
is_phone_verification_enabled: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
type User {
|
type User {
|
||||||
|
|
|
@ -106,6 +106,16 @@ func MetaResolver(ctx context.Context) (*model.Meta, error) {
|
||||||
log.Debug("Failed to get Disable Basic Authentication from environment variable", err)
|
log.Debug("Failed to get Disable Basic Authentication from environment variable", err)
|
||||||
isBasicAuthDisabled = true
|
isBasicAuthDisabled = true
|
||||||
}
|
}
|
||||||
|
isMobileBasicAuthDisabled, err := memorystore.Provider.GetBoolStoreEnvVariable(constants.EnvKeyDisableMobileBasicAuthentication)
|
||||||
|
if err != nil {
|
||||||
|
log.Debug("Failed to get Disable Basic Authentication from environment variable", err)
|
||||||
|
isMobileBasicAuthDisabled = true
|
||||||
|
}
|
||||||
|
isMobileVerificationDisabled, err := memorystore.Provider.GetBoolStoreEnvVariable(constants.EnvKeyDisablePhoneVerification)
|
||||||
|
if err != nil {
|
||||||
|
log.Debug("Failed to get Disable Basic Authentication from environment variable", err)
|
||||||
|
isMobileVerificationDisabled = true
|
||||||
|
}
|
||||||
|
|
||||||
isEmailVerificationDisabled, err := memorystore.Provider.GetBoolStoreEnvVariable(constants.EnvKeyDisableEmailVerification)
|
isEmailVerificationDisabled, err := memorystore.Provider.GetBoolStoreEnvVariable(constants.EnvKeyDisableEmailVerification)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -153,6 +163,8 @@ func MetaResolver(ctx context.Context) (*model.Meta, error) {
|
||||||
IsSignUpEnabled: !isSignUpDisabled,
|
IsSignUpEnabled: !isSignUpDisabled,
|
||||||
IsStrongPasswordEnabled: !isStrongPasswordDisabled,
|
IsStrongPasswordEnabled: !isStrongPasswordDisabled,
|
||||||
IsMultiFactorAuthEnabled: !isMultiFactorAuthenticationEnabled,
|
IsMultiFactorAuthEnabled: !isMultiFactorAuthenticationEnabled,
|
||||||
|
IsMobileBasicAuthenticationEnabled: !isMobileBasicAuthDisabled,
|
||||||
|
IsPhoneVerificationEnabled: !isMobileVerificationDisabled,
|
||||||
}
|
}
|
||||||
return &metaInfo, nil
|
return &metaInfo, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user