mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-12 11:20:40 +03:00
c63ee519ea
Previously we had to create a separate API key to give access to chrome extension so we can make calls to the DB. This PR includes logic to initiate a oauth flow with PKCE method which redirects to the `Authorise` screen to give access to server tokens. Implemented in this PR- 1. make `redirectUrl` a non-nullable parameter 2. Add `NODE_ENV` to environment variable service 3. new env variable `CHROME_EXTENSION_REDIRECT_URL` on server side 4. strict checks for redirectUrl 5. try catch blocks on utils db query methods 6. refactor Apollo Client to handle `unauthorized` condition 7. input field to enter server url (for self-hosting) 8. state to show user if its already connected 9. show error if oauth flow is cancelled by user Follow up PR - Renew token logic --------- Co-authored-by: Félix Malfait <felix@twenty.com>
24 lines
772 B
JSON
24 lines
772 B
JSON
{
|
|
"name": "twenty-chrome-extension",
|
|
"description": "",
|
|
"private": true,
|
|
"version": "0.0.1",
|
|
"type": "module",
|
|
"scripts": {
|
|
"nx": "NX_DEFAULT_PROJECT=twenty-chrome-extension node ../../node_modules/nx/bin/nx.js",
|
|
"clean": "rimraf ./dist",
|
|
"start": "yarn clean && VITE_MODE=development vite",
|
|
"build": "yarn clean && tsc && vite build",
|
|
"lint": "eslint . --report-unused-disable-directives --max-warnings 0 --config .eslintrc.cjs",
|
|
"graphql:generate": "graphql-codegen",
|
|
"fmt": "prettier --check \"src/**/*.ts\" \"src/**/*.tsx\"",
|
|
"fmt:fix": "prettier --cache --write \"src/**/*.ts\" \"src/**/*.tsx\""
|
|
},
|
|
"dependencies": {
|
|
"@types/chrome": "^0.0.256"
|
|
},
|
|
"devDependencies": {
|
|
"@crxjs/vite-plugin": "^1.0.14"
|
|
}
|
|
}
|