This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from typing import List, Optional, Dict, Any | |
from time import time | |
import threading | |
from jwt import PyJWK, PyJWKSet, decode | |
from jwt.exceptions import DecodeError | |
class RWMutex: | |
def __init__(self): | |
self._lock = threading.Lock() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright (c) 2022, VRAI Labs and/or its affiliates. All rights reserved. | |
* | |
* This software is licensed under the Apache License, Version 2.0 (the | |
* "License") as published by the Apache Software Foundation. | |
* | |
* You may not use this file except in compliance with the License. You may | |
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any, Dict, List, Union | |
import httpx | |
from supertokens_python.recipe.thirdparty.provider import Provider | |
from supertokens_python.recipe.thirdparty.types import UserInfo, UserInfoEmail, AccessTokenAPI, AuthorisationRedirectAPI | |
from jwt import decode # type: ignore | |
from jwt.algorithms import RSAAlgorithm | |
async def verify_id_token_from_jwks_endpoint_and_get_payload( | |
id_token: str, jwks_uri: str, audience: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Building Remix app in production mode... | |
✘ [ERROR] Could not resolve "~/styles/components/Header.css" | |
app/components/Header.tsx:7:40: | |
7 │ ... { default as headerStyles } from "~/styles/components/Header.css"; | |
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
You can mark the path "~/styles/components/Header.css" as external to exclude it from the bundle, which will remove this error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const cors = require("cors"); | |
const helmet = require("helmet"); | |
require("dotenv").config(); | |
let supertokens = require("supertokens-node"); | |
let Session = require("supertokens-node/recipe/session"); | |
let { verifySession } = require("supertokens-node/recipe/session/framework/express"); | |
let { middleware, errorHandler } = require("supertokens-node/framework/express"); | |
let ThirdPartyEmailPassword = require("supertokens-node/recipe/thirdpartyemailpassword"); | |
let EmailVerification = require("supertokens-node/recipe/emailverification"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const cors = require("cors"); | |
const helmet = require("helmet"); | |
require("dotenv").config(); | |
let supertokens = require("supertokens-node"); | |
let Session = require("supertokens-node/recipe/session"); | |
let { verifySession } = require("supertokens-node/recipe/session/framework/express"); | |
let { middleware, errorHandler } = require("supertokens-node/framework/express"); | |
let ThirdPartyEmailPassword = require("supertokens-node/recipe/thirdpartyemailpassword"); | |
let EmailVerification = require("supertokens-node/recipe/emailverification"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EmailPassword.init({ | |
override: { | |
apis: (oI) => { | |
return { | |
...oI, | |
signUpPOST: async function (input) { | |
let email = input.formFields.find(i => i.id === "email"); | |
let oldUser = fetchUserFromOldeAuth(email); | |
if (oldUser !== undefined) { | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override: { | |
components: { | |
ThirdPartySignInAndUpHeader_Override: ({ DefaultComponent, ...props }) => { | |
return ( | |
<div> | |
<img src="octocat.jpg" /> | |
<DefaultComponent {...props} /> | |
</div> | |
); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Session.init({ | |
override: { | |
functions: (oI) => { | |
return { | |
...oI, | |
createNewSession: async function (input) { | |
let userInfo = await ThirdParty.getUserById(input.userId); | |
input.accessTokenPayload = { | |
...input.accessTokenPayload, | |
email: userInfo!.email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ThirdPartySignInAndUpProvidersForm_Override: ({ DefaultComponent, ...props }) => { | |
return ( | |
<div> | |
<img src="octocat.jpg" /> | |
<DefaultComponent {...props} /> | |
</div> | |
); | |
}, |
NewerOlder