rajhans84
01/26/2022, 2:15 AMrp
01/26/2022, 3:31 AMrajhans84
01/26/2022, 3:40 AMrp
01/26/2022, 3:42 AMrajhans84
01/26/2022, 3:42 AMrp
01/26/2022, 3:43 AMrajhans84
01/26/2022, 3:45 AMrp
01/26/2022, 3:46 AMrajhans84
01/26/2022, 3:49 AMrp
01/26/2022, 3:49 AMrajhans84
01/26/2022, 3:51 AMrp
01/26/2022, 3:51 AMrajhans84
01/26/2022, 3:53 AMrp
01/26/2022, 3:53 AMrajhans84
01/26/2022, 3:55 AMrp
01/26/2022, 4:00 AMrajhans84
01/26/2022, 4:00 AMrp
01/26/2022, 4:01 AMrajhans84
01/26/2022, 4:02 AMrp
01/26/2022, 4:03 AMrajhans84
01/26/2022, 4:04 AMrp
01/26/2022, 4:06 AMrajhans84
01/26/2022, 4:09 AMrp
01/26/2022, 4:10 AMrajhans84
01/26/2022, 4:12 AMrp
01/26/2022, 4:12 AMrajhans84
01/26/2022, 4:14 AMrp
01/26/2022, 4:21 AMrajhans84
01/26/2022, 4:27 AMrp
01/26/2022, 4:33 AMrajhans84
01/26/2022, 4:34 AMrp
01/26/2022, 4:34 AMrajhans84
01/26/2022, 4:35 AMrp
01/26/2022, 4:36 AMrajhans84
01/26/2022, 4:36 AMrp
01/26/2022, 4:39 AMrajhans84
01/26/2022, 4:39 AMrp
01/26/2022, 4:41 AMdoesUserExistInAuth0
to doesUserExistInYourDB
and validateAndGetUserInfoFromAuth0
to validateAndGetUserInfoFromYourDB
.rajhans84
01/26/2022, 4:46 AMrp
01/26/2022, 5:41 AMrajhans84
01/26/2022, 5:42 AMrp
01/26/2022, 5:43 AMrajhans84
01/26/2022, 5:44 AMrp
01/26/2022, 5:46 AMrajhans84
01/26/2022, 5:48 AMrp
01/26/2022, 10:38 AMrajhans84
01/26/2022, 8:57 PMFile "C:\git\ptnzapi\ptnz_api\__init__.py", line 14, in <module>
from supertokens_python.framework.flask import Middleware
File "C:\git\ptnzapi\venv37\lib\site-packages\supertokens_python\__init__.py", line 16, in <module>
from .supertokens import Supertokens
File "C:\git\ptnzapi\venv37\lib\site-packages\supertokens_python\supertokens.py", line 34, in <module>
from .recipe.session.cookie_and_header import attach_access_token_to_cookie, clear_cookies, \
File "C:\git\ptnzapi\venv37\lib\site-packages\supertokens_python\recipe\session\__init__.py", line 14, in <module>
from typing import Union, Literal
ImportError: cannot import name 'Literal' from 'typing' (C:\Users\HansRajBhardwaj\.pyenv\pyenv-win\versions\3.7.9\lib\typing.py)
rp
01/26/2022, 8:58 PMrajhans84
01/26/2022, 8:58 PMrp
01/26/2022, 8:58 PMrajhans84
01/26/2022, 10:31 PMAre you sending too many / too few formFields?
rp
01/27/2022, 4:26 AMrajhans84
01/27/2022, 4:28 AMinit(
app_info=InputAppInfo(
app_name="Big Brother 3 Website",
api_domain="http://localhost:5000",
website_domain="http://localhost:3000"
),
supertokens_config=SupertokensConfig(
# These are the connection details of the app you created on supertokens.com
connection_uri="https://d5bfb0117e4711ec9dc4c73b52b17527-ap-southeast-1.aws.supertokens.io:3570",
api_key="my api key"
),
framework='flask',
recipe_list=[
session.init(), # initializes session features
emailpassword.init(
# TODO: See next step*/
)
]
)
app = Flask(__name__)
Middleware(app)
CORS(
app=app,
origins=[
"http://localhost:3000"
],
supports_credentials=True,
allow_headers=["Content-Type"] + get_all_cors_headers(),
)
rp
01/27/2022, 4:29 AMrajhans84
01/27/2022, 4:29 AMimport EmailPasswordReact from 'supertokens-auth-react/recipe/emailpassword'
import SessionReact from 'supertokens-auth-react/recipe/session'
import { appInfo } from './appInfo'
export const frontendConfig = () => {
return {
appInfo,
recipeList: [
EmailPasswordReact.init(),
SessionReact.init(),
],
}
}
email
and password
to it?rp
01/27/2022, 4:32 AMrajhans84
01/27/2022, 4:32 AMrp
01/27/2022, 4:34 AMrajhans84
01/27/2022, 4:34 AMAccess to fetch at 'http://localhost:5000/auth/signin' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
rp
01/27/2022, 4:35 AMrajhans84
01/27/2022, 4:42 AMrp
01/27/2022, 4:43 AMrajhans84
01/27/2022, 4:50 AMrp
01/27/2022, 4:51 AMrajhans84
01/27/2022, 4:51 AMrp
01/27/2022, 4:52 AMrajhans84
01/27/2022, 4:54 AMcurl --location --request POST 'http://localhost:5000/auth/signup' \
--header 'rid: emailpassword' \
--header 'Content-Type: application/json' \
--data-raw '{
"formFields": [
{
"id": "email",
"value": "test1234@gmail.com"
},
{
"id": "password",
"value": "test1234"
}
]
}'
rp
01/27/2022, 4:54 AMkakashi_44
01/27/2022, 11:02 AMpython
from supertokens_python import init, get_all_cors_headers, SupertokensConfig, InputAppInfo
from supertokens_python.recipe import session, emailpassword
from supertokens_python.framework.flask.flask_middleware import Middleware
from flask import Flask
from flask_cors import CORS
init(
supertokens_config=SupertokensConfig('https://try.supertokens.io'),
app_info=InputAppInfo(
app_name="SuperTokens Python SDK Testing",
api_domain="http://localhost:9000",
website_domain="http://localhost:3000"
),
framework='flask',
recipe_list=[
session.init(),
emailpassword.init()
]
)
app = Flask(__name__)
Middleware(app)
CORS(
app=app,
supports_credentials=True,
origins="http://localhost:3000",
allow_headers=['Content-Type'] + get_all_cors_headers()
)
@app.route("/", defaults={"path": ""})
@app.route("/<path:path>")
def index(_):
return ''
app.run(host="0.0.0.0", port=9000)
rajhans84
01/27/2022, 9:03 PMasync
lib i guess.response = await matched_recipe.handle_api_request(request_id, request, path, method, response)
rp
01/28/2022, 5:04 AMkakashi_44
01/28/2022, 6:02 AM