iCloud Two Factor Authorisation doesn't show code on trusted devices
There are a view things you should check:

1) Are both devices marked as 'trusted' in icloud.com (login, go to settings and see 'my devices'.

2) You have to be signed in with both devices with your iCloud account. Did you check both are correctly activated.