Skip to content

Commit 19c0f29

Browse files
Merge pull request #487 from supertokens/remove-combination-recipe/base
Remove combination recipe/base
2 parents a6d4210 + 5fbc417 commit 19c0f29

File tree

93 files changed

+1367
-11428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1367
-11428
lines changed

CHANGELOG.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,136 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [unreleased]
1010

11+
## [0.21.0] - 2024-05-23
12+
13+
### Breaking change
14+
15+
- Removed ThirdPartyEmailPassword and ThirdPartyPasswordless recipes. Instead, you should use ThirdParty + EmailPassword or ThirdParty + Passwordless recipes separately in your recipe list.
16+
- Removed `rid` query param from:
17+
- email verification links
18+
- passwordless magic links
19+
- password reset links
20+
21+
### Changes
22+
23+
- If `rid` header is present in an API call, the routing no only only depends on that. If the SDK cannot resolve a request handler based on the `rid`, request path and method, it will try to resolve a request handler only based on the request path and method (therefore ignoring the `rid` header).
24+
- New API handlers are:
25+
- `GET /emailpassword/email/exists` => email password, does email exist API (used to be `GET /signup/email/exists` with `rid` of `emailpassword` or `thirdpartyemailpassword` which is now deprecated)
26+
- `GET /passwordless/email/exists` => email password, does email exist API (used to be `GET /signup/email/exists` with `rid` of `passwordless` or `thirdpartypasswordless` which is now deprecated)
27+
- `GET /passwordless/phonenumber/exists` => email password, does email exist API (used to be `GET /signup/phonenumber/exists` which is now deprecated)
28+
- Support for FDI 2.0
29+
30+
### Migration guide
31+
32+
- If you were using `ThirdPartyEmailPassword`, you should now init `ThirdParty` and `EmailPassword` recipes separately. The config for the individual recipes are mostly the same, except the syntax may be different. Check our recipe guides for [ThirdParty](https://supertokens.com/docs/thirdparty/introduction) and [EmailPassword](https://supertokens.com/docs/emailpassword/introduction) for more information.
33+
34+
- If you were using `ThirdPartyPasswordless`, you should now init `ThirdParty` and `Passwordless` recipes separately. The config for the individual recipes are mostly the same, except the syntax may be different. Check our recipe guides for [ThirdParty](https://supertokens.com/docs/thirdparty/introduction) and [Passwordless](https://supertokens.com/docs/passwordless/introduction) for more information.
35+
36+
- The way to get user information has changed:
37+
- If you are using `get_users_by_email` from `thirdpartyemailpassword` recipe:
38+
39+
Before:
40+
```python
41+
from supertokens_python.recipe.thirdpartyemailpassword.syncio import get_users_by_email
42+
43+
user_info = get_users_by_email("public", "[email protected]")
44+
```
45+
46+
After:
47+
```python
48+
from supertokens_python.recipe.thirdparty.syncio import get_users_by_email as get_users_by_email_third_party
49+
from supertokens_python.recipe.emailpassword.syncio import get_user_by_email as get_user_by_email_emailpassword
50+
51+
third_party_user_info = get_users_by_email_third_party("public", "[email protected]")
52+
53+
email_password_user_info = get_user_by_email_emailpassword("public", "[email protected]")
54+
55+
if email_password_user_info is not None:
56+
print(email_password_user_info)
57+
58+
if len(third_party_user_info) > 0:
59+
print(third_party_user_info)
60+
```
61+
62+
- If you are using `get_user_id` from `thirdpartyemailpassword` recipe:
63+
64+
Before:
65+
```python
66+
from supertokens_python.recipe.thirdpartyemailpassword.syncio import get_user_by_id
67+
68+
_ = get_user_by_id(user_id)
69+
```
70+
71+
After:
72+
```python
73+
from supertokens_python.recipe.thirdparty.syncio import (
74+
get_user_by_id as get_user_by_id_thirdparty,
75+
)
76+
from supertokens_python.recipe.emailpassword.syncio import (
77+
get_user_by_id as get_user_by_id_emailpassword,
78+
)
79+
80+
thirdparty_user = get_user_by_id_thirdparty(user_id)
81+
if thirdparty_user is None:
82+
email_password_user = get_user_by_id_emailpassword(user_id)
83+
if email_password_user is not None:
84+
print(email_password_user)
85+
else:
86+
print(thirdparty_user)
87+
```
88+
89+
- If you are using `get_users_by_email` from `thirdpartypasswordless` recipe:
90+
91+
Before:
92+
```python
93+
from supertokens_python.recipe.thirdpartypasswordless.syncio import get_users_by_email
94+
95+
user_info = get_users_by_email("public", "[email protected]")
96+
```
97+
98+
After:
99+
```python
100+
from supertokens_python.recipe.thirdparty.syncio import get_users_by_email as get_users_by_email_third_party
101+
from supertokens_python.recipe.passwordless.syncio import get_user_by_email as get_user_by_email_passwordless
102+
103+
third_party_user_info = get_users_by_email_third_party("public", "[email protected]")
104+
105+
passwordless_user_info = get_user_by_email_passwordless("public", "[email protected]")
106+
107+
if passwordless_user_info is not None:
108+
print(passwordless_user_info)
109+
110+
if len(third_party_user_info) > 0:
111+
print(third_party_user_info)
112+
```
113+
114+
- If you are using `get_user_id` from `thirdpartypasswordless` recipe:
115+
116+
Before:
117+
```python
118+
from supertokens_python.recipe.thirdpartypasswordless.syncio import get_user_by_id
119+
120+
_ = get_user_by_id(user_id)
121+
```
122+
123+
After:
124+
```python
125+
from supertokens_python.recipe.thirdparty.syncio import (
126+
get_user_by_id as get_user_by_id_thirdparty,
127+
)
128+
from supertokens_python.recipe.passwordless.syncio import (
129+
get_user_by_id as get_user_by_id_passwordless,
130+
)
131+
132+
thirdparty_user = get_user_by_id_thirdparty(user_id)
133+
if thirdparty_user is None:
134+
passwordless_user = get_user_by_id_passwordless(user_id)
135+
if passwordless_user is not None:
136+
print(passwordless_user)
137+
else:
138+
print(thirdparty_user)
139+
```
140+
11141
## [0.20.2] - 2024-05-17
12142

13143
- Improves FastAPI middleware performance using recommended ASGI middleware implementation.

examples/with-django/with-thirdpartyemailpassword/project/settings.py

Lines changed: 94 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@
2323
get_all_cors_headers,
2424
init,
2525
)
26-
from supertokens_python.recipe import (
27-
dashboard,
28-
emailverification,
29-
session,
30-
thirdpartyemailpassword,
31-
)
26+
from supertokens_python.recipe import dashboard, emailverification, session, thirdparty
27+
28+
# from tests import thirdparty
3229

3330
# Build paths inside the project like this: BASE_DIR / 'subdir'.
3431
BASE_DIR = Path(__file__).resolve().parent.parent
@@ -63,92 +60,98 @@ def get_website_domain():
6360
session.init(),
6461
dashboard.init(),
6562
emailverification.init("REQUIRED"),
66-
thirdpartyemailpassword.init(
67-
providers=[
68-
thirdpartyemailpassword.ProviderInput(
69-
config=thirdpartyemailpassword.ProviderConfig(
70-
third_party_id="google",
71-
clients=[
72-
thirdpartyemailpassword.ProviderClientConfig(
73-
client_id=os.environ["GOOGLE_CLIENT_ID"],
74-
client_secret=os.environ["GOOGLE_CLIENT_SECRET"],
75-
client_type="web",
76-
),
77-
thirdpartyemailpassword.ProviderClientConfig(
78-
client_id=os.environ["GOOGLE_CLIENT_ID_MOBILE"],
79-
client_secret=os.environ["GOOGLE_CLIENT_SECRET_MOBILE"],
80-
client_type="mobile",
81-
),
82-
],
63+
thirdparty.init(
64+
sign_in_and_up_feature=thirdparty.SignInAndUpFeature(
65+
providers=[
66+
thirdparty.ProviderInput(
67+
config=thirdparty.ProviderConfig(
68+
third_party_id="google",
69+
clients=[
70+
thirdparty.ProviderClientConfig(
71+
client_id=os.environ["GOOGLE_CLIENT_ID"],
72+
client_secret=os.environ["GOOGLE_CLIENT_SECRET"],
73+
client_type="web",
74+
),
75+
thirdparty.ProviderClientConfig(
76+
client_id=os.environ["GOOGLE_CLIENT_ID_MOBILE"],
77+
client_secret=os.environ[
78+
"GOOGLE_CLIENT_SECRET_MOBILE"
79+
],
80+
client_type="mobile",
81+
),
82+
],
83+
),
84+
),
85+
thirdparty.ProviderInput(
86+
config=thirdparty.ProviderConfig(
87+
third_party_id="github",
88+
clients=[
89+
thirdparty.ProviderClientConfig(
90+
client_id=os.environ["GITHUB_CLIENT_ID"],
91+
client_secret=os.environ["GITHUB_CLIENT_SECRET"],
92+
client_type="web",
93+
),
94+
thirdparty.ProviderClientConfig(
95+
client_id=os.environ["GITHUB_CLIENT_ID_MOBILE"],
96+
client_secret=os.environ[
97+
"GITHUB_CLIENT_SECRET_MOBILE"
98+
],
99+
client_type="mobile",
100+
),
101+
],
102+
)
103+
),
104+
thirdparty.ProviderInput(
105+
config=thirdparty.ProviderConfig(
106+
third_party_id="apple",
107+
clients=[
108+
thirdparty.ProviderClientConfig(
109+
client_id=os.environ["APPLE_CLIENT_ID"],
110+
client_type="web",
111+
additional_config={
112+
"keyId": os.environ["APPLE_KEY_ID"],
113+
"teamId": os.environ["APPLE_TEAM_ID"],
114+
"privateKey": os.environ["APPLE_PRIVATE_KEY"],
115+
},
116+
),
117+
thirdparty.ProviderClientConfig(
118+
client_id=os.environ["APPLE_CLIENT_ID_MOBILE"],
119+
client_type="mobile",
120+
additional_config={
121+
"keyId": os.environ["APPLE_KEY_ID"],
122+
"teamId": os.environ["APPLE_TEAM_ID"],
123+
"privateKey": os.environ["APPLE_PRIVATE_KEY"],
124+
},
125+
),
126+
],
127+
)
128+
),
129+
thirdparty.ProviderInput(
130+
config=thirdparty.ProviderConfig(
131+
third_party_id="google-workspaces",
132+
clients=[
133+
thirdparty.ProviderClientConfig(
134+
client_id=os.environ["GOOGLE_WORKSPACES_CLIENT_ID"],
135+
client_secret=os.environ[
136+
"GOOGLE_WORKSPACES_CLIENT_SECRET"
137+
],
138+
),
139+
],
140+
)
141+
),
142+
thirdparty.ProviderInput(
143+
config=thirdparty.ProviderConfig(
144+
third_party_id="discord",
145+
clients=[
146+
thirdparty.ProviderClientConfig(
147+
client_id=os.environ["DISCORD_CLIENT_ID"],
148+
client_secret=os.environ["DISCORD_CLIENT_SECRET"],
149+
),
150+
],
151+
)
83152
),
84-
),
85-
thirdpartyemailpassword.ProviderInput(
86-
config=thirdpartyemailpassword.ProviderConfig(
87-
third_party_id="github",
88-
clients=[
89-
thirdpartyemailpassword.ProviderClientConfig(
90-
client_id=os.environ["GITHUB_CLIENT_ID"],
91-
client_secret=os.environ["GITHUB_CLIENT_SECRET"],
92-
client_type="web",
93-
),
94-
thirdpartyemailpassword.ProviderClientConfig(
95-
client_id=os.environ["GITHUB_CLIENT_ID_MOBILE"],
96-
client_secret=os.environ["GITHUB_CLIENT_SECRET_MOBILE"],
97-
client_type="mobile",
98-
),
99-
],
100-
)
101-
),
102-
thirdpartyemailpassword.ProviderInput(
103-
config=thirdpartyemailpassword.ProviderConfig(
104-
third_party_id="apple",
105-
clients=[
106-
thirdpartyemailpassword.ProviderClientConfig(
107-
client_id=os.environ["APPLE_CLIENT_ID"],
108-
client_type="web",
109-
additional_config={
110-
"keyId": os.environ["APPLE_KEY_ID"],
111-
"teamId": os.environ["APPLE_TEAM_ID"],
112-
"privateKey": os.environ["APPLE_PRIVATE_KEY"],
113-
},
114-
),
115-
thirdpartyemailpassword.ProviderClientConfig(
116-
client_id=os.environ["APPLE_CLIENT_ID_MOBILE"],
117-
client_type="mobile",
118-
additional_config={
119-
"keyId": os.environ["APPLE_KEY_ID"],
120-
"teamId": os.environ["APPLE_TEAM_ID"],
121-
"privateKey": os.environ["APPLE_PRIVATE_KEY"],
122-
},
123-
),
124-
],
125-
)
126-
),
127-
thirdpartyemailpassword.ProviderInput(
128-
config=thirdpartyemailpassword.ProviderConfig(
129-
third_party_id="google-workspaces",
130-
clients=[
131-
thirdpartyemailpassword.ProviderClientConfig(
132-
client_id=os.environ["GOOGLE_WORKSPACES_CLIENT_ID"],
133-
client_secret=os.environ[
134-
"GOOGLE_WORKSPACES_CLIENT_SECRET"
135-
],
136-
),
137-
],
138-
)
139-
),
140-
thirdpartyemailpassword.ProviderInput(
141-
config=thirdpartyemailpassword.ProviderConfig(
142-
third_party_id="discord",
143-
clients=[
144-
thirdpartyemailpassword.ProviderClientConfig(
145-
client_id=os.environ["DISCORD_CLIENT_ID"],
146-
client_secret=os.environ["DISCORD_CLIENT_SECRET"],
147-
),
148-
],
149-
)
150-
),
151-
]
153+
]
154+
)
152155
),
153156
],
154157
telemetry=False,

0 commit comments

Comments
 (0)