JohnCoene / firebase

Google FIrebase for shiny
https://firebase.john-coene.com
GNU Affero General Public License v3.0
171 stars 26 forks source link

How to migrate to the new version? #22

Closed dcaud closed 2 years ago

dcaud commented 2 years ago

I've got an existing app that uses firebase. After upgrading firebase to 1.0, the firebase stuff doesn't work (e.g., no providers are shown). I saw a message to use firebaseUIContainer, but switching that for useFirebaseUI didn't work.

I can try to create repro's of my specific issues, but I'm wondering if there are any obvious steps needed to upgrade to 1.0.

Thanks for the library!

JohnCoene commented 2 years ago

Sorry, I messed up the CRAN submission. Could you reinstall from Github and try again?

dcaud commented 2 years ago

Running remotes::install_github("JohnCoene/firebase") gets more functionality.

One thing that doesn't seem to work now is a password reset. I'm using f$reset_password(email = email). Is there anything else I need to do?

I see the below in the documentation:

Breaking FirebaseEmailLink the method called send has been renamed to send_email: this method was overwriting an internal private method, actually breaking many things.

However, I'm not sure what I need to change. thanks!

JohnCoene commented 2 years ago

You just need to change the send method send to send_email.

f <- FirebaseEmailLink$new()
f$send_email("me@email.com")
dcaud commented 2 years ago

I'm not seeing a send method in the old version. Hmm.

dcaud commented 2 years ago

Hi. I'm still unable to get the password reset to work. I'm feeling quite lost and would appreciate some assistance.

With Firebase V 1 I've tried

f <- FirebaseEmailLink$new()
f$send_email(email = input$email_for_password_reset)

where in the prior Firebase version I had

  f$reset_password(email = input$email_for_password_reset)

That doesn't work.

I also tried the following in the R console:

FirebaseEmailLink$new()

which returned:

ℹ Fetching firebase config from file Error in private$.namespace(session) : attempt to apply non-function

JohnCoene commented 2 years ago

The FirebaseEmailLink sends the user a link that redirects and logs in to the app: there was no reset_password method on this class since there is no password to reset. This method is on the FirebaseEmailPassword.

The error you see when running from the R console is normal, you have no shiny session object.

It's difficult to debug without an example of the code that goes wrong, sorry.

dcaud commented 2 years ago

My question is now answered. Pointing me to the correct method was what I needed. Thanks!! Just in case others have the same issue:

Where before I had:

  f$reset_password(email = input$email_for_password_reset)

In the new version, the following works:

  f <- FirebaseEmailPassword$new()
  f$reset_password(email = input$email_for_password_reset)
JohnCoene commented 2 years ago

Great to hear it is resolved!