Implemented XF2 Two step authentication system improvements

Jake B.

Well-known member
The TFA system in xf2 doesn't seem very improved over what was available for xf1, for example I can't request information (such as a user's mobile number for SMS verification) before running the trigger function. I worked around this in xf1, and can work around it the same way in xf2 but it'd be nice to have the ability to have a pre-trigger step of some sort that can run as that would make the system much more flexible
 
Upvote 6
This suggestion has been implemented. Votes are no longer accepted.
Beta 7 should make this easier:
  • Providers now have a requiresConfig method which will default to false. Override that to return true.
  • Implement the new handleConfig() method in a somewhat similar way to handleManage(). In this case, once you have the data you need, you'd return null and set the new provider data into the by-reference $config variable.
  • That config data will be passed to the new $config second argument of generateInitialData(). You'd then add whatever initial data you need (if any) and return the "final" config (like before). Setup will then proceed as normal (with a test run before enabling).
 
Beta 7 should make this easier:
  • Providers now have a requiresConfig method which will default to false. Override that to return true.
  • Implement the new handleConfig() method in a somewhat similar way to handleManage(). In this case, once you have the data you need, you'd return null and set the new provider data into the by-reference $config variable.
  • That config data will be passed to the new $config second argument of generateInitialData(). You'd then add whatever initial data you need (if any) and return the "final" config (like before). Setup will then proceed as normal (with a test run before enabling).

Awesome, excited to have a look! Should make our 2fa add-on quite a bit less hacky :)
 
Top Bottom