Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's not an issue but seeking help on getting and saving user data while facebook login. #169

Open
sagarguhe opened this issue Jan 3, 2015 · 0 comments

Comments

@sagarguhe
Copy link

In my application I have three users and each user having their own model which manages their login. I am using prefixes to change the Auth user model dynamically in beforefilter, so each and every user can access only those methods which have their respective user prefix, say admins login is managed through Admin Model, students Model authenticate Students, and Institute user login through Institute Model. However the cake Auth and also Nicks plugin works perfectly. But plugin saves only facebook_id and password. I also used the:

//Add an email field to be saved along with creation.
function beforeFacebookSave(){
$this->Connect->authUser['User']['email'] = $this->Connect->user('email');
return true; //Must return true or will not save.
}

but nothing happened and when I refreshed the page it threw the SQL Integrity Constraint error saying email must not be NULL. When I removed this method after refresh I get redirected to the after login page of my application, which was expected without refresh.

Now I want to get and save email, Name, gender of the user, also I have set the public_profile, email 'perms' for facebook login button. Where is the problem I am not able to figure out.

P.S. I have set the component and helper in Model controller and not in AppController.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant