firebase / FirebaseUI-Android

Optimized UI components for Firebase
https://firebaseopensource.com/projects/firebase/firebaseui-android/
Apache License 2.0
4.63k stars 1.84k forks source link

Outdated documentation for email-link setup #1909

Open theHilikus opened 3 years ago

theHilikus commented 3 years ago

Email-link signin was not working in my app when the email link was clicked in the Outlook app. I traced it to this line in the official documentation, which doesn't seem to have a good reason to exist, AFAICT

https://github.com/firebase/FirebaseUI-Android/blame/master/auth/README.md#L297

For some reason, the gmail app does have extras in the intent but not the outlook app. In any case, that null check seems unnecessary: nothing in the sample code in the README derefences getIntent().getExtras() and moreover, everything works fine even when extras is null. Is this just outdated documentation?

samtstern commented 3 years ago

That line was added here: https://github.com/firebase/FirebaseUI-Android/pull/1503

To be honest I am not sure what it was meant to do ... seems like you're right and we should probably remove it

omaksymov commented 2 years ago

@samtstern Initial code reference is pointing to wrong part of README today, so more robust reference is: https://github.com/firebase/FirebaseUI-Android/blob/980d0cc8e0f319fece43c23716ec126858936fea/auth/README.md?plain=1#L374-L376

That code seemed to be in parity with this documentation - see sources in snippets-android repo: Kotlin, Java. And in fact it is outdated as pointed out in https://stackoverflow.com/questions/58350107/firebase-ui-email-link-signin-intent-extra-is-null. So checking intent extras should be replaced with just intent.getData().toString() in all parts of related documentation. After doing this linter will warn about link being non-nullable, so if (link != null) check can be removed as well.