magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

OAuth is not persisted after app restart

Open SergeyYuhimovich opened this issue 3 years ago • 3 comments

✅ Prerequisites

  • [x] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • [x] Are you running the latest SDK version?
  • [x] Are you reporting to the correct repository (magic-sdk)?

🐛 Description

m.user.isLoggedIn() returns false after successful social log in (Google in my case) and app restart.

🧩 Steps to Reproduce

  1. Log in using m.oauth.loginWithPopup({ provider: 'google', redirectURI: REDIRECT_URI })
  2. Restart the app
  3. Call m.user.isLoggedIn()

🤔 Expected behavior

m.user.isLoggedIn() returns true

😮 Actual behavior

m.user.isLoggedIn() returns false

🌎 Environment

Software Version(s)
magic-sdk 8.1.0
Browser
yarn 1.22.10
Operating System macOS 12.1, iPhone simulator with iOS 15.2

SergeyYuhimovich avatar Feb 10 '22 09:02 SergeyYuhimovich

Start taking a look.

Ethella avatar Feb 23 '22 00:02 Ethella

Some follow-up to this ticket. This issue happens only on iOS devices, where our auth relayer storage gets partitioned and made ephemeral by Apple Webkit ITP. We'll investigate for a better solution, but very unlikely in a short term.

Ethella avatar Mar 08 '22 00:03 Ethella

Is there any update here? This creates a pretty bad experience for our iOS users.

pkayfire avatar Sep 09 '22 04:09 pkayfire

I wanted to follow up here. I see this happening on Google Chrome as well.

pkayfire avatar Oct 04 '22 23:10 pkayfire

@Ethella

pkayfire avatar Oct 04 '22 23:10 pkayfire

@pkayfire The fix to the current issue is planned for the first half of Q4. I'll comment in this thread if there's any update

Please let me know if this is a blocker for you and if you're releasing your app anytime soon.

Ethella avatar Oct 04 '22 23:10 Ethella

Thanks for the response. Our app is currently live and we're paying for a Magic Plus Auth subscription. The paid subscription doesn't deliver any value though if we can't have authenticated routes due to this issue. Is there any way you can fast track the fix? @Ethella

pkayfire avatar Oct 05 '22 00:10 pkayfire

Thanks for the feedback. I'll have to relay this back to the team to see if we are able to accommodate your request. I'll get back to you shortly.

Ethella avatar Oct 05 '22 00:10 Ethella

Thank you! I am seeing this issue on Safari and Chrome if it helps make the request more urgent to the team.

pkayfire avatar Oct 05 '22 00:10 pkayfire

@Ethella Will the fix be available for non-expo apps?

rcorrie avatar Oct 07 '22 01:10 rcorrie

@Ethella Will the fix be available for non-expo apps?

Yes, the fix will be available across all platforms / frameworks

Ethella avatar Oct 13 '22 23:10 Ethella

Thank you! I am seeing this issue on Safari and Chrome if it helps make the request more urgent to the team.

Sorry for the late reply. The first half in Q4 is the best we can do, as we have quite a few major updates coming up. Thank you for your patience. 🙏

Ethella avatar Oct 13 '22 23:10 Ethella

Got it -- thanks for letting us know. Will watch for updates on this issue. Thanks!

pkayfire avatar Oct 14 '22 23:10 pkayfire

Hi I just wanted to follow up here to see if your team is on track to release a fix for this issue in the first half of Q4. Thanks!

pkayfire avatar Nov 04 '22 00:11 pkayfire

Just wanted to follow up again, since the first half of Q4 is ending in 7 days.

We are Magic Auth Plus users and will most likely have to cancel our subscription if this isn't fixed in a timely manner. Thanks

pkayfire avatar Nov 08 '22 21:11 pkayfire

@pkayfire Our Mobile team is actively working on this and we are still on track to have this resolved by the end of Q4. We will update this issue thread when there is more to share.

am-hernandez avatar Nov 09 '22 23:11 am-hernandez

It's very misleading for your team to promise a fix by the first half of Q4 and now say it's going to take an additional 2 months.

Your product is an authentication toolkit, yet you can't keep your customers' users authenticated and it's been broken for almost 9 months? I'm sorry, but that's unacceptable as a venture-backed startup.

pkayfire avatar Nov 09 '22 23:11 pkayfire

Hey @pkayfire, I apologize for the misinformation. As promised, we aim to have this problem resolved by the end of this week. The PR is under review, and it's been our top priority. I'll notify you once it's been released to prod. Thank you for your patience!

Ethella avatar Nov 10 '22 00:11 Ethella

Appreciate the update -- looking forward to a resolution. Thanks

pkayfire avatar Nov 10 '22 01:11 pkayfire

Hey, @pkayfire. Another update to this ticket, the fix we raised requires a security enhancement which will push back the expected release day to the following Monday. I'll keep you informed and keep updating the status in the thread. 🙏

Ethella avatar Nov 10 '22 19:11 Ethella

Got it — thanks!

On Thu, Nov 10, 2022 at 11:35 AM Jerry Liu @.***> wrote:

Hey, @pkayfire https://github.com/pkayfire. Another update to this ticket, the fix we raised requires a security enhancement which will push back the expected release day to the following Monday. I'll keep you informed and keep updating the status in the thread. 🙏

— Reply to this email directly, view it on GitHub https://github.com/magiclabs/magic-js/issues/279#issuecomment-1310802189, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATINSJOVLFO7HWHNBAI253WHVE65ANCNFSM5OACEEXA . You are receiving this because you were mentioned.Message ID: @.***>

-- Sent from Gmail Mobile

pkayfire avatar Nov 10 '22 19:11 pkayfire

Hey @Ethella, I also wanted to confirm whether this fix would affect Chrome Desktop as well? We've been seeing a similar problem on both Mobile Safari + Chrome Desktop. I sent over our Magic auth integration code earlier today to confirm it's not an issue on our end.

pkayfire avatar Nov 10 '22 20:11 pkayfire

My gut feeling is, they are different problems because we don't receive issues reported from customers who are on a Chrome Desktop. I'll make sure the OAuth session persistence issue for mobile is completely out of your way first, and then I'll take a deeper look at the desktop problems.

Ethella avatar Nov 10 '22 21:11 Ethella

Hey. There are messages above that people got the same issue on Web. I also see the same in Google Chrome. Please, take a look on this. The issue in Chrome is 100% the same. After reload - user.isLoggedIn() returns false, so the session is not persisted. This happens only if you use social login (I've tried with google auth)

mikeavvad avatar Nov 14 '22 08:11 mikeavvad

A fix has been rolled out. I can confirm the OAuth session persistence issue has been resolved. Please give it a try and let us know how it looks.

Ethella avatar Nov 14 '22 22:11 Ethella

@mikeavvad For Chrome desktop, please give it a try again and let us know if the issue still persists. Feel free to start a new issue and post your findings in it.

Ethella avatar Nov 14 '22 22:11 Ethella

Hi, will you be updating the NPM package with this fix?

pkayfire avatar Nov 14 '22 22:11 pkayfire

@pkayfire No need to update the NPM packages. If you are still seeing this issue, restart the app, and it should be good.

Ethella avatar Nov 14 '22 23:11 Ethella

got it -- thanks for letting me know. We'll report back if we still encounter the issue.

pkayfire avatar Nov 14 '22 23:11 pkayfire