You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SocialAuthenticator examples show stashing the Social ID in the user model. Is that just for illustrative purposes or does that really makes sense from a modeling perspective? It seems like it might make more sense to have another table to make it easier to connect multiple social accounts.
The second question is where should I store the auth token? Should I store it in my User Model?
The text was updated successfully, but these errors were encountered:
The SocialAuthenticator examples show stashing the Social ID in the user model. Is that just for illustrative purposes or does that really makes sense from a modeling perspective? It seems like it might make more sense to have another table to make it easier to connect multiple social accounts.
I think it's ok to do it either way, but I prefer right on the model, it's simpler. We actually have things like facebookId, twitterId, etc on our User class for KnpU. If we need to reference the Twitter ID specifically, we know exactly where it is.
The second question is where should I store the auth token? Should I store it in my User Model?
Good question. Maybe nowhere :). If all you want to do is make an immediate request for some data, then make that request, and don't store the token anywhere. If you want to do some offline processing or make API calls later, you'll need to store it. But, tokens are temporary, so you may need to also fetch and save a refresh token (and some systems don't even have that). So, it depends on your use-case - we don't store them anywhere for KnpU.
I have a couple of questions here.
The SocialAuthenticator examples show stashing the Social ID in the user model. Is that just for illustrative purposes or does that really makes sense from a modeling perspective? It seems like it might make more sense to have another table to make it easier to connect multiple social accounts.
The second question is where should I store the auth token? Should I store it in my User Model?
The text was updated successfully, but these errors were encountered: