Skip to content

Can't login with another account after logout #1147

@Jaylin0920

Description

@Jaylin0920

when I logout,I use

let loginManager = LoginManager()
loginManager.logOut()

when I login, I use

 let loginManager = LoginManager()
loginManager.logIn(permissions: [.userBirthday, .userGender, .userHometown, .userLocation], viewController: frVc) { result in
}

when I login,i want to use phone/email and password to change another account, but there show last stored user information everytime,how can i change another account???

If I manually clear the data, Setting->Safari->Advanced->Website Data -> facebook.com,slide left to delete it,it works and i can use phone/email and password to change another account,why sdk ''loginManager.logOut()" does't works,how can i change another account???

Activity

Jaylin0920

Jaylin0920 commented on Dec 10, 2019

@Jaylin0920
Author

sdk version, pod 'FacebookLogin', '0.9.0'

robtimp

robtimp commented on Dec 17, 2019

@robtimp
Contributor

Unfortunately, that works as intended and there's currently no way to switch accounts within the login dialog once a user has logged in.

I've brought up the need for better multi-user support for Facebook Login and it's on our roadmap. I'll let the team know that developers are requesting it.

ay8s

ay8s commented on Dec 20, 2019

@ay8s

@robtimp +1 for that. Thanks! 👍

aleksandr-lavrinenko

aleksandr-lavrinenko commented on Dec 20, 2019

@aleksandr-lavrinenko

+1 for that, really need this feature

sparseware

sparseware commented on Dec 29, 2019

@sparseware

Aside from the multi-user support issue, it is also a security and privacy issue as the user is never really logged out (no credentials required to log back in)

kevin-js

kevin-js commented on Feb 25, 2020

@kevin-js

+1, it would be great if the caching behavior can be specified through a flag in the login call like

let fbLoginManager = LoginManager()
fbLoginManager.logIn(permissions: [.email, .userBirthday], viewController: self, retainSessionOnLogout: false) { result in
...
}

Trying to toggle between accounts has been a major pain point in testing so any updates on the feature roadmap for multi-user support would be much appreciated.

Edit: Thinking further on the above example it might be better to specify the login retention policy in the logout call to transition existing user sessions more seamlessly, that way the end user would be able to toggle accounts the first time they log out instead of logging out/logging back in/logging out again to apply the changes.

twototwoto

twototwoto commented on Mar 9, 2020

@twototwoto

+1 for that. Thanks! 👍

rvsood

rvsood commented on May 5, 2020

@rvsood

Does anyone have any workaround that they have been using in the meantime? I see in the section on reauthentication on developers.facebook.com where it says apps should create their own methods for switching between Facebook user accounts, but solutions posted on, e.g., StackOverflow are 5+ years old and don't seem to work anymore, and questions on this problem are going unanswered in the Facebook developer community forums.

joesus

joesus commented on May 5, 2020

@joesus
Contributor

sdk version, pod 'FacebookLogin', '0.9.0'

Side note: this pod refers to the deprecated facebook-swift-sdk. You almost certainly want to be using the equivalent code in this repository.

For versions below 7.0 please use:

pod 'FBSDKLoginKit/Swift'
pod 'FBSDKCoreKit/Swift'

For versions 7.0 and above please use:

pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'

Thanks!

boygiandi

boygiandi commented on May 20, 2020

@boygiandi

I have the same problem. I login with this Facebook Account, and now, I can't change it. I did logout, clear Safari web data, remove app and re-install. When I tap Login with Facebook, I still see my Facebook Account and no button to change to another one. Where did Facebook store that account ?

Faydee1220

Faydee1220 commented on Jun 9, 2020

@Faydee1220

I found out how to log out finally...
We have to go to facebook website and login the account you want to log out, then go to Settings -> Security and Login -> Where You're Logged In, and choose the device you want to log out.
image

sergeymild

sergeymild commented on Nov 17, 2020

@sergeymild

can't switch account after logout, previously it works after logout in safari, but now even in safari i can't logout either

18 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tidbeck@ay8s@renanvs@KovtunOleg@sergeymild

        Issue actions

          Can't login with another account after logout · Issue #1147 · facebook/facebook-ios-sdk