IMPORTANT: In order to pass SafetyNet, enable "MagiskHide" option in the Magisk app (settings) then enable for apps detecting 'root' (shield icon in Magisk app => "MagiskHide" menu).
RECOMMENDED: Use "Hide the Magisk app" option in Magisk app (settings).
N.B.: If "Hide the Magisk app" option doesn't work for you, follow these steps:
1) Go in phone's settings => My Device => All specs => Tap 7~10 times on "MIUI Version" tile to be a developer
2) Return back in main phone's settings menu => Additional settings => Developer options (at the bottom of the screen) => Enable "Install via USB" option (in "Debug" section)
3) In Magisk app => Settings => Tap on "Hide the Magisk app" and install the "hidden" Magisk app (give it another name)