da.fant
05/23/2023, 12:36 PMsession/refresh
)
https://github.com/supertokens/supertokens-python/blob/master/examples/with-fastapi/with-thirdpartyemailpassword/main.pyrp_st
05/23/2023, 12:38 PMrp_st
05/23/2023, 12:38 PMrp_st
05/23/2023, 12:39 PMda.fant
05/23/2023, 12:58 PM2023-05-23 13:56:54 MacBook-Pro-141.lan com.supertokens[94025] DEBUG {"t": "2023-05-23T12:56:54.654Z", "sdkVer": "0.14.0", "message": "middleware: Checking recipe ID for match: emailverification", "file": "supertokens.py:495"}
com.supertokens {"t": "2023-05-23T12:56:54.655Z", "sdkVer": "0.14.0", "message": "middleware: Checking recipe ID for match: thirdpartyemailpassword", "file": "supertokens.py:495"}
2023-05-23 13:56:54 MacBook-Pro-141.lan com.supertokens[94025] DEBUG {"t": "2023-05-23T12:56:54.655Z", "sdkVer": "0.14.0", "message": "middleware: Checking recipe ID for match: thirdpartyemailpassword", "file": "supertokens.py:495"}
com.supertokens {"t": "2023-05-23T12:56:54.655Z", "sdkVer": "0.14.0", "message": "middleware: Not handling because no recipe matched", "file": "supertokens.py:508"}
2023-05-23 13:56:54 MacBook-Pro-141.lan com.supertokens[94025] DEBUG {"t": "2023-05-23T12:56:54.655Z", "sdkVer": "0.14.0", "message": "middleware: Not handling because no recipe matched", "file": "supertokens.py:508"}
INFO: 127.0.0.1:51648 - "OPTIONS /auth/authorisationurl?thirdPartyId=google HTTP/1.1" 400 Bad Request
da.fant
05/23/2023, 12:58 PMrp_st
05/23/2023, 12:58 PMrp_st
05/23/2023, 12:59 PMda.fant
05/23/2023, 1:10 PMinit(
supertokens_config=SupertokensConfig(connection_uri="https://try.supertokens.io"),
# supertokens_config=SupertokensConfig(connection_uri=os.getenv('SUPERTOKENS_API_URL')),
app_info=InputAppInfo(
app_name="Godmode",
api_domain=os.getenv("API_URL"),
website_domain=os.getenv("APP_URL"),
# api_gateway_path="",
),
framework="fastapi",
recipe_list=[
session.init(),
dashboard.init(),
emailverification.init("REQUIRED"),
thirdpartyemailpassword.init(
providers=[
Google(
is_default=True,
client_id=os.environ.get("GOOGLE_CLIENT_ID"), # type: ignore
client_secret=os.environ.get("GOOGLE_CLIENT_SECRET"), # type: ignore
),
Google(
client_id=os.environ.get("GOOGLE_CLIENT_ID_MOBILE"), # type: ignore
client_secret=os.environ.get("GOOGLE_CLIENT_SECRET"), # type: ignore
),
Github(
is_default=True,
client_id=os.environ.get("GITHUB_CLIENT_ID"), # type: ignore
client_secret=os.environ.get("GITHUB_CLIENT_SECRET"), # type: ignore
),
Github(
client_id=os.environ.get("GITHUB_CLIENT_ID_MOBILE"), # type: ignore
client_secret=os.environ.get("GITHUB_CLIENT_SECRET_MOBILE"), # type: ignore
),
GoogleWorkspaces(
is_default=True,
client_id=os.environ.get("GOOGLE_WORKSPACES_CLIENT_ID"), # type: ignore
client_secret=os.environ.get("GOOGLE_WORKSPACES_CLIENT_SECRET"), # type: ignore
),
]
),
],
telemetry=False,
)
da.fant
05/23/2023, 1:10 PM2023-05-23 14:08:09 MacBook-Pro-141.lan com.supertokens[94756] DEBUG {"t": "2023-05-23T13:08:09.893Z", "sdkVer": "0.14.0", "message": "middleware: Checking recipe ID for match: emailverification", "file": "supertokens.py:482"}
com.supertokens {"t": "2023-05-23T13:08:09.893Z", "sdkVer": "0.14.0", "message": "middleware: Checking recipe ID for match: thirdpartyemailpassword", "file": "supertokens.py:482"}
2023-05-23 14:08:09 MacBook-Pro-141.lan com.supertokens[94756] DEBUG {"t": "2023-05-23T13:08:09.893Z", "sdkVer": "0.14.0", "message": "middleware: Checking recipe ID for match: thirdpartyemailpassword", "file": "supertokens.py:482"}
com.supertokens {"t": "2023-05-23T13:08:09.894Z", "sdkVer": "0.14.0", "message": "middleware: Not handling because no recipe matched", "file": "supertokens.py:508"}
2023-05-23 14:08:09 MacBook-Pro-141.lan com.supertokens[94756] DEBUG {"t": "2023-05-23T13:08:09.894Z", "sdkVer": "0.14.0", "message": "middleware: Not handling because no recipe matched", "file": "supertokens.py:508"}
INFO: 127.0.0.1:54556 - "GET /auth/authorisationurl?thirdPartyId=google HTTP/1.1" 404 Not Found
rp_st
05/23/2023, 1:12 PMda.fant
05/23/2023, 1:12 PMts
export const config = (): SuperTokensConfig => {
return {
appInfo,
enableDebugLogs: true,
recipeList: [
ThirdPartyReact.init({
signInAndUpFeature: {
providers: [
ThirdPartyReact.Google.init(),
ThirdPartyReact.Github.init(),
],
},
}),
SessionReact.init(),
],
windowHandler: (oI: any) => {
return {
...oI,
location: {
...oI.location,
setHref: (href: string) => {
Router.push(href)
},
},
}
},
}
}
rp_st
05/23/2023, 1:13 PMrp_st
05/23/2023, 1:13 PMda.fant
05/23/2023, 1:25 PMpython
app.add_middleware(
CORSMiddleware,
# allow_origins=["*"],
allow_origins=[os.getenv('APP_URL')],
# allow_methods=["GET", "PUT", "POST", "DELETE", "OPTIONS", "PATCH"],
allow_methods=["*"],
allow_headers=["*"],
allow_credentials=True,
# allow_headers=["Content-Type"] + get_all_cors_headers(),
)
req goes through, but browser holds it due to cors: cess to fetch at 'http://localhost:8000/auth/authorisationurl?thirdPartyId=google' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
The rest of my API (unauthed though) works perfectly w CORS. Anything you recognize?da.fant
05/23/2023, 1:29 PMrp_st
05/23/2023, 1:35 PMda.fant
05/23/2023, 1:37 PMda.fant
05/23/2023, 1:37 PMrp_st
05/23/2023, 1:39 PMda.fant
05/23/2023, 1:40 PM{org_id}:admin
etc and then have basically 1000s of roles?da.fant
05/23/2023, 1:40 PMrp_st
05/23/2023, 1:45 PMda.fant
05/23/2023, 1:46 PMrp_st
05/23/2023, 1:48 PMda.fant
05/23/2023, 2:12 PMcss
* {
font-family: system-ui;
}
[data-supertokens~="providerButtonLeft"] {
margin: 0;
}
[data-supertokens~="headerTitle"] {
letter-spacing: unset;
font-weight: 500;
font-size: var(--font-size-2);
}
[data-supertokens~="headerTitle"]::before {
content: " ";
display: block;
width: 100%;
height: 80px;
background-image: url(/logo.png);
background-size: contain;
background-repeat:no-repeat;
background-position: center center;
margin-bottom: 16px;
}
[data-supertokens~="button"] {
height: unset;
font-size: var(--font-size-2);
padding: 8px;
display: flex;
justify-content: center;
}
https://cdn.discordapp.com/attachments/1110546820809117767/1110570958932164628/image.png▾
rp_st
05/23/2023, 2:22 PMda.fant
05/26/2023, 1:23 AMrp_st
05/26/2023, 4:15 AMda.fant
05/26/2023, 1:20 PM"Failed to create init process: failed to load /usr/local/bin/docker-entrypoint.sh: exec format error"
I tried deploying registry.supertokens.io/supertokens/supertokens-postgresql:5.0
to GCP Cloud Run
env:
API_KEYS=...
POSTGRESQL_CONNECTION_URI=postgresql://...
SUPERTOKENS_PORT=8080
any ideas on what might go wrong?rp_st
05/26/2023, 1:22 PMrp_st
05/26/2023, 1:22 PMda.fant
05/26/2023, 1:23 PMbash
PROJECT_ID="..."
DEPLOYMENT_NAME="..."
IMAGE_NAME="gcr.io/$PROJECT_ID/api"
REGION="us-central1"
gcloud config set project $PROJECT_ID
SUPERTOKENS_IMAGE_NAME="registry.supertokens.io/supertokens/supertokens-postgresql:5.0"
docker pull $SUPERTOKENS_IMAGE_NAME
docker tag $SUPERTOKENS_IMAGE_NAME $IMAGE_NAME
docker push $IMAGE_NAME
ENV_VARS=$(grep -v '^#' .env.demo.supertokens | xargs echo | tr ' ' ',')
gcloud run deploy $DEPLOYMENT_NAME \
--image $IMAGE_NAME \
--region $REGION \
--platform managed \
--allow-unauthenticated \
--update-env-vars $ENV_VARS
rp_st
05/26/2023, 1:26 PMkakashi_44
05/26/2023, 1:40 PMkakashi_44
05/26/2023, 1:41 PMda.fant
05/26/2023, 2:48 PMda.fant
05/26/2023, 2:48 PMda.fant
05/26/2023, 2:49 PMda.fant
05/26/2023, 2:53 PMda.fant
05/26/2023, 2:53 PMdocker pull --platform linux/amd64 $SUPERTOKENS_IMAGE_NAME
kakashi_44
05/26/2023, 2:53 PMkakashi_44
05/26/2023, 2:53 PMda.fant
05/26/2023, 9:56 PM/recipe/user/roles
for each role:
/recipe/role/permissions
and check if the perm is in the listda.fant
05/26/2023, 9:57 PM{organization_id}:admin
has perms {organization_id}:task.write
. in the endpoint to write a task, I'd want to check if the current user has that permissionrp_st
05/27/2023, 5:18 AM