if (isFirstLoginToday()) { console.log('First login today: grant the reward.'); } else { console.log('The player already logged in today.'); }
This is device-local state, so it can be reset by clearing storage and does not synchronize between devices. Use a trusted server date for authoritative rewards.