Skip to content

Commit

Permalink
[IMP] use correct terminology for 2fa
Browse files Browse the repository at this point in the history
  • Loading branch information
fmartins-odoogap committed Sep 2, 2024
1 parent 32a4a9d commit daa9678
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions graphql_vuestorefront/schemas/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,16 @@ class User(OdooObjectType):
name = graphene.String(required=True)
email = graphene.String(required=True)
partner = graphene.Field(lambda: Partner)
two_factor_email = graphene.Boolean()
mfa_enabled = graphene.Boolean()

def resolve_email(self, info):
return self.login or None

def resolve_partner(self, info):
return self.partner_id or None

def resolve_two_factor_email(self, info):
if self._mfa_type() == 'totp_mail':
return True
return False
def resolve_mfa_enabled(self, info):
return bool(self._mfa_type())


class Currency(OdooObjectType):
Expand Down
4 changes: 2 additions & 2 deletions graphql_vuestorefront/schemas/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def mutate(self, info, current_password, new_password):
raise GraphQLError(_('You must be logged in.'))


class TwoFactorVerification(graphene.Mutation):
class TotpVerification(graphene.Mutation):
class Arguments:
code = graphene.String(required=True)
user_id = graphene.Int(required=True)
Expand Down Expand Up @@ -249,4 +249,4 @@ class SignMutation(graphene.ObjectType):
change_password = ChangePassword.Field(description="Set new user's password with the token from the change "
"password url received in the email.")
update_password = UpdatePassword.Field(description="Update user password.")
two_factor_verification = TwoFactorVerification.Field(description="Two-Factor Verification")
totp_verification = TotpVerification.Field(description="Two-Factor Verification")

0 comments on commit daa9678

Please sign in to comment.