PassportJS Facebook login isAuthenticated returns false even though authentication succeeds
Date : March 29 2020, 07:55 AM
wish helps you Try moving the cookieParser and session middleware to before the Passport middleware: app.use(express.cookieParser());
app.use(express.session({ secret: '--- OMMITTED ---' }));
app.use(passport.initialize());
app.use(passport.session());
|
When adding a .post() event listener to a Keystone model the isNew property always returns false
Date : March 29 2020, 07:55 AM
Hope this helps This is a mongoose thing as far as I know. After you save the object, it is no longer new. Kinda makes sense once you think about it that way. The only workaround I've found is to put a custom attribute on the object during a pretty save handler, and removing it post save after using it to determine if the object had just been saved for the first time.
|
Swift - Parse Facebook Login Immediately Defaults to User Cancelled Login
Tag : ios , By : user126922
Date : March 29 2020, 07:55 AM
hope this fix your issue This code will work if you set up the frameworks correctly and follow the steps of Parse's Facebook setup guide ( https://parse.com/docs/ios/guide#users-facebook-users). The two main differences I'm noticing between this and your code is the syntax for the PFFacebookUtils Login function in your view controller and the func application at the very end of your app delegate is put before the func applicationWillTerminate in mine. AppDelegate.swift import UIKit
import CoreData
import Parse
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
//X's replace my actual Parse information
Parse.setApplicationId("XXXXXXXXXXXXXXXXXXXXXX", clientKey: "XXXXXXXXXXXXXXXXXXXXXX")
PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
FBSDKAppEvents.activateApp()
}
/*
func application(application: UIApplication, url: NSURL, sourceApplication: NSString, annotation: AnyObject) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(
application,
openURL: url,
sourceApplication: sourceApplication as String,
annotation: annotation)
}*/
func application(application: UIApplication,
openURL url: NSURL,
sourceApplication: String?,
annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application,
openURL: url,
sourceApplication: sourceApplication,
annotation: annotation)
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
let permissions = [ "email","user_birthday", "public_profile", "user_friends"]
@IBAction func loginButtonPressed(sender: AnyObject) {
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
(user: PFUser?, error: NSError?) -> Void in
if let user = user {
if user.isNew {
println("User signed up and logged in through Facebook!")
} else {
println("User logged in through Facebook!")
}
} else {
println("Uh oh. The user cancelled the Facebook login.")
}
}
}
}
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
#import <Parse/Parse.h>
|
Facebook login button in Android returns user to the same page after logging in
Tag : java , By : chintown
Date : March 29 2020, 07:55 AM
With these it helps I dont think you are getting callback in onActivityResult() in your FbFragment Please check it and tell if any exception thrown..
|
Parse Facebook Login: User return null & Callback already registered for <facebook> error
Date : March 29 2020, 07:55 AM
I wish did fix the issue. I've found the answer. The problem is because I Initialize parsefacebook and facebooksdk at the wrong classes (I should initialize at application instead).
|