MCPcopy
hub / github.com/iMerica/dj-rest-auth / activate

Method activate

dj_rest_auth/mfa/totp.py:34–40  ·  view source on GitHub ↗
(user, secret)

Source from the content-addressed store, hash-verified

32class TOTP:
33 @staticmethod
34 def activate(user, secret):
35 authenticator, _ = Authenticator.objects.update_or_create(
36 user=user,
37 type=Authenticator.Type.TOTP,
38 defaults={'data': {'secret': _signer.sign(secret)}},
39 )
40 return authenticator
41
42 @staticmethod
43 def deactivate(user):

Calls

no outgoing calls