Comments (6)
So I got a version/workaround working that basically goes like this:
-when a user starts the login/signup process using username/pw provider, check to see if they have a graph.cool account
-if they do and its a username/pw account, proceed as usual
-if they do but its a facebook account, tell them they should just login with facebook and don't let them use username/pw
-when a user starts the login/signup process using fb, let them signup/login through facebook then check to see if they have a graph.cool account
-if they do and its a fb account, no problem, proceed as usual
-if they do but its a username/pw account, prompt them to connect their facebook profile to it by signing in with their username/pw account and then using auth0's api to link the two accounts on auth0's end -- once you do that you can login to graph.cool with either fb or username/pw without any duplication problems.
Will try to give a live example / code once I iron a few things out. Also Auth0 keeps messing with their api docs -- like, while I'm working on this... so who knows what will be the best way to do this tomorrow... 🙄
from prisma1.
I'm working on a solution for this and right now I'm thinking that the best way to handle it is to make sure that a second graph.cool user never gets created. I'm going to try and set up my authentication process so that it automatically creates the new auth0 account and merges it with the existing so that graph.cool never needs to worry about multiple auth0ids. I'll let you know how it goes.
from prisma1.
@carlpeaslee when you link the accounts, there is a primary and secondary user. In my experience, as long as you maintain the primary user in the linking process, the Graph.cool account persists between the various connections. Auth0 provides a Rule for this, which I am using, but you need to reverse the user Ids in the API call when linking the accounts in order to maintain the primary user.
However, depending on your login/signup flow, this can cause problems. The accesstoken/idtoken returned from Auth0 on the first login attempt when the accounts are not yet linked (the rule has not run yet) are not valid. I am assuming this is because that user doesn't get created and instead gets merged, so we actually want the accessToken and IdToken from the primary user that this login will be merged with.
I am still working on a way to solve that issue for my own use, but it only happens on the first login, but all subsequent logins (once the accounts are merged) the idToken/accessToken are correct and everything persists in Graph.cool.
from prisma1.
Hello guys, I'm facing the same issues here. How about creating a Hook to actually create the Graphcool user directly from Auth0?
from prisma1.
I'm facing the same issues. +1 for @picosam requesting a Hook.
@cartogram I am not sure how you are reversing it. Where in the rule do you modify it? Do you just call data = data.reverse() before the loop?
from prisma1.
This issue has been moved to graphcool/graphcool-framework.
from prisma1.
Related Issues (20)
- Self-relation column order? HOT 1
- Prisma1 with Apple M1 HOT 7
- Mutations with disconnect=true on an relation that is not connected to anything fails with an error HOT 1
- Circular dependency while mocking the Prisma client using both approach singelton and context
- host.docker.internal not working on prismagraphql/prisma:1.34 on docker-compose (1.29.2) docker 20.10.9 CentOS 8.4.2105 HOT 1
- Intermittent P1001 - "Can't reach database server..." HOT 1
- `updatedAt` field not changing after running a connect operation via the update mutation HOT 1
- Prisma 1.34 documentation errors HOT 1
- Invalid Issue Documentation link HOT 1
- log4j - CVE-2021-4428 HOT 2
- The type of `where` part of `delete` function is wrong when using `@@unique`
- Prisma 1 Cloud was sunset on September 1st, 2022 HOT 3
- Error prisma1 deploy HOT 1
- Cascade delete not set on one-to-many relation HOT 1
- prisma1 introspect does not return anything
- updatedFields always returns an empty array HOT 1
- Prisma1 deploy throws 504 Gateway Time-out randomly HOT 2
- "Join" where result would have been a big data set throws an error (performance) HOT 1
- Issues adding or modifying records in Admin
- Prisma 1 was deprecated on Sept, 1st 2022 — Upgrade to the latest version of Prisma
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma1.