@@ -77,7 +77,9 @@ export const getLoginMethodAndParams = (firebase, creds) => {
7777 applicationVerifier,
7878 credential
7979 } = creds
80+ // Credential Auth
8081 if ( credential ) {
82+ // Attempt to use signInAndRetrieveDataWithCredential if it exists (see #467 for more info)
8183 const credentialAuth = firebase . auth ( ) . signInAndRetrieveDataWithCredential
8284
8385 if ( credentialAuth ) {
@@ -88,6 +90,8 @@ export const getLoginMethodAndParams = (firebase, creds) => {
8890 }
8991 return { method : 'signInWithCredential' , params : [ credential ] }
9092 }
93+
94+ // Provider Auth
9195 if ( provider ) {
9296 // Verify providerName is valid
9397 if ( supportedAuthProviders . indexOf ( provider . toLowerCase ( ) ) === - 1 ) {
@@ -104,7 +108,10 @@ export const getLoginMethodAndParams = (firebase, creds) => {
104108 }
105109 return { method : 'signInWithRedirect' , params : [ authProvider ] }
106110 }
111+
112+ // Token Auth
107113 if ( token ) {
114+ // Check for new sign in method (see #484 for more info)
108115 const tokenAuth = firebase . auth ( ) . signInAndRetrieveDataWithCustomToken
109116
110117 if ( tokenAuth ) {
@@ -113,6 +120,8 @@ export const getLoginMethodAndParams = (firebase, creds) => {
113120
114121 return { method : 'signInWithCustomToken' , params : [ token ] }
115122 }
123+
124+ // Phone Number Auth
116125 if ( phoneNumber ) {
117126 if ( ! applicationVerifier ) {
118127 throw new Error (
@@ -125,9 +134,10 @@ export const getLoginMethodAndParams = (firebase, creds) => {
125134 }
126135 }
127136
137+ // Email/Password Auth
138+ // Check for new sign in method (see #484 for more info)
128139 const emailPasswordAuth = firebase . auth ( )
129140 . signInAndRetrieveDataWithEmailAndPassword
130-
131141 if ( emailPasswordAuth ) {
132142 return {
133143 method : 'signInAndRetrieveDataWithEmailAndPassword' ,
0 commit comments