Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/authorization #31

Merged
merged 88 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
64d494a
feat: authorizatoin
kirill-ivanovvv Jun 19, 2024
57cecce
fix: yarn check
kirill-ivanovvv Jun 19, 2024
1052420
fix: delete unused
kirill-ivanovvv Jun 20, 2024
119fd73
fix(registration.fragment): moved out constants and hooks
kirill-ivanovvv Jun 20, 2024
8c5247a
fix(registration-endpoint): mode endpoint from api to page dir
kirill-ivanovvv Jun 20, 2024
09df48c
fix: remove unused deps
kirill-ivanovvv Jun 20, 2024
0b133fe
fix(registration.page): split component into client and server
kirill-ivanovvv Jun 20, 2024
bf7e6db
yarn check
kirill-ivanovvv Jun 20, 2024
5e66d8d
master merge
kirill-ivanovvv Jun 20, 2024
105b46b
feat: add env
kirill-ivanovvv Jun 20, 2024
686f7c7
fix(env): move env check to the top
kirill-ivanovvv Jun 20, 2024
d33e4cb
yarn
kirill-ivanovvv Jun 20, 2024
0019b0f
feat(package.json): add globals directory
kirill-ivanovvv Jun 20, 2024
3b1ba8b
feat(globals/data): get github access tokken func
kirill-ivanovvv Jun 20, 2024
908897a
fix(registration.server): write gh tokkent to cookies
kirill-ivanovvv Jun 20, 2024
151a68b
fix(base-layout): devide component to server and client parts
kirill-ivanovvv Jun 20, 2024
231f10e
fix(add-member-to-org): locales fix
kirill-ivanovvv Jun 21, 2024
2ddd900
fix(base-layout): dark-theme fix
kirill-ivanovvv Jun 21, 2024
cdd526e
fix(registration.server): move octokit auth func from @globals to reg…
kirill-ivanovvv Jun 21, 2024
d26b860
feat(entrypoint): additional env check
kirill-ivanovvv Jun 21, 2024
7d2803c
refactor(registration.server): refactor
kirill-ivanovvv Jun 21, 2024
6ac6c91
yarn
kirill-ivanovvv Jun 21, 2024
9dbe758
fix(package.json): delete unused
kirill-ivanovvv Jun 21, 2024
4b92ca5
draft: authorization; scopes
kirill-ivanovvv Jun 21, 2024
af273dd
feat: authentificated as app on root server layout
kirill-ivanovvv Jun 21, 2024
52619e1
feat(base-layout-data): get data, what base layout needed
kirill-ivanovvv Jun 21, 2024
033cbd2
feat(locales): move locales to @global
kirill-ivanovvv Jun 21, 2024
464a054
yarn
kirill-ivanovvv Jun 21, 2024
c20e03b
feat(endpoints): create workspace
kirill-ivanovvv Jun 21, 2024
0cbce12
feat(gh-server-app): create server-component
kirill-ivanovvv Jun 21, 2024
942f81a
feat(globals): add private utils func
kirill-ivanovvv Jun 21, 2024
6d61839
feat(globals): add utils functions
kirill-ivanovvv Jun 21, 2024
31e1a5f
yarn
kirill-ivanovvv Jun 21, 2024
e7ad61f
fix(globals): remove privates
kirill-ivanovvv Jun 21, 2024
0404cc7
fix(gh-app-server-component): fix private key auth method
kirill-ivanovvv Jun 21, 2024
fa0e125
fix(root-layout): divided into 2 components
kirill-ivanovvv Jun 21, 2024
c71683c
fix(registration-fragment): moves endpoint function to endpoint
kirill-ivanovvv Jun 21, 2024
d097ecb
feat(api): endpoint provide; change route after success auth
kirill-ivanovvv Jun 21, 2024
6ad63f0
fix(root-layout): moves all logic to fragment
kirill-ivanovvv Jun 21, 2024
d08f395
fix: some service changes
kirill-ivanovvv Jun 21, 2024
087e586
feat(base-layout): render authed user data on cli
kirill-ivanovvv Jun 21, 2024
a099162
yarn
kirill-ivanovvv Jun 22, 2024
3754695
feat(globals.data): graphql codegen
kirill-ivanovvv Jun 22, 2024
db432d8
fix(base-layout): move data logic to globals data
kirill-ivanovvv Jun 22, 2024
9c540df
fix(globals.data): fix data generation; query suntax fixes
kirill-ivanovvv Jun 22, 2024
ce8b6ca
feat(middleware): check token cookie&redirect
kirill-ivanovvv Jun 22, 2024
9c2f546
feat(base-layout): redirect on cookie expires
kirill-ivanovvv Jun 22, 2024
0437157
fix(root-layout): remove GH server app
kirill-ivanovvv Jun 22, 2024
f378ca3
feat(endpoint): add constants
kirill-ivanovvv Jun 22, 2024
73a5a37
fix(gh-server-app): remove
kirill-ivanovvv Jun 22, 2024
0e79707
feat: logout
kirill-ivanovvv Jun 22, 2024
90cc70e
feat(sidebar): render open state without items
kirill-ivanovvv Jun 22, 2024
1e47159
yarn
kirill-ivanovvv Jun 22, 2024
6575a47
fix(base-layout): height fix
kirill-ivanovvv Jun 22, 2024
0ef2946
fix: yarn check
kirill-ivanovvv Jun 23, 2024
58002d3
fix: move locals to global
kirill-ivanovvv Jun 23, 2024
89d3cdb
feat: layout
kirill-ivanovvv Jun 24, 2024
79a28a1
feat: animations
kirill-ivanovvv Jun 24, 2024
907a7a4
refactor: devided into interfaces and styles
kirill-ivanovvv Jun 24, 2024
456d3b0
chore: feat/authrorization merge
kirill-ivanovvv Jun 24, 2024
a527b80
chore: yarn check
kirill-ivanovvv Jun 24, 2024
6d7ccc6
fix: review changes
kirill-ivanovvv Jun 25, 2024
c56e5f7
feat(base-layout): get gh url from query
kirill-ivanovvv Jun 25, 2024
427a8cb
feat(icons): add colors props; logo default colors and color props
kirill-ivanovvv Jun 25, 2024
a77db0a
feat(logo): add logo dard variant
kirill-ivanovvv Jun 25, 2024
e55bbf2
feat(sidebar): dark theme; and redirect to viewer gh page
kirill-ivanovvv Jun 25, 2024
48660d3
feat(base-layout): add profile url to query; update graph ql codegen
kirill-ivanovvv Jun 25, 2024
6841e2d
yarn
kirill-ivanovvv Jun 25, 2024
7c93598
feat(yarnrc): added missing dependencies
kirill-ivanovvv Jun 25, 2024
b0bf756
feat(atls-logo): active theme props
kirill-ivanovvv Jun 25, 2024
87df5f9
fix: yarn check fixes
kirill-ivanovvv Jun 25, 2024
0f8e11c
refactor: small review changes
kirill-ivanovvv Jun 26, 2024
bdfb6ce
fix: gql codegen interface fix
kirill-ivanovvv Jun 26, 2024
a039037
fix: query props fixes
kirill-ivanovvv Jun 26, 2024
e09bd30
yarn
kirill-ivanovvv Jun 28, 2024
d58c974
fix: change octokit auth interface to fetch; change auth as oAuthApp …
kirill-ivanovvv Jun 28, 2024
78e6b88
refactor(token): add cookie name to env
kirill-ivanovvv Jul 1, 2024
f684c29
refactor(get-gh-auth-token): change names
kirill-ivanovvv Jul 1, 2024
b0798a7
refactor(check-envs): change func; moved required vars to consts file
kirill-ivanovvv Jul 1, 2024
70a96e1
refactor(api): namings; throw error
kirill-ivanovvv Jul 1, 2024
22c5fa5
fix(registration): auth hook
kirill-ivanovvv Jul 1, 2024
bfd5d9f
feat(root-layout): render error message; client hook for get error me…
kirill-ivanovvv Jul 1, 2024
fd9a1c2
fix(check-envs): func fix
kirill-ivanovvv Jul 1, 2024
9bf4440
feat(ui): add error message component
kirill-ivanovvv Jul 1, 2024
286544f
feat(theme): add color-const props to light and dark global object
kirill-ivanovvv Jul 1, 2024
d553d70
yarn
kirill-ivanovvv Jul 1, 2024
b2c02f1
fix: check env func fix
kirill-ivanovvv Jul 1, 2024
9abb4f4
refactor: root layout use layout
kirill-ivanovvv Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
238 changes: 238 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions app/entrypoints/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"start": "node dist/src/index.cjs"
},
"dependencies": {
"@apollo/client": "3.10.5",
"graphql": "16.8.2",
"react-intl": "6.6.8"
},
"devDependencies": {
Expand All @@ -27,5 +29,8 @@
"react-dom": "18.3.1",
"react-intl": "6.6.8",
"typescript": "5.2.2"
},
"peerDependencies": {
"typescript": "*"
Nelfimov marked this conversation as resolved.
Show resolved Hide resolved
}
}
14 changes: 14 additions & 0 deletions app/entrypoints/renderer/src/app/api/github/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-ignore:next-line
import { cookies } from 'next/headers'
// @ts-ignore:next-line
import { redirect } from 'next/navigation'

export async function GET(request: Request) {
const { searchParams } = new URL(request.url)

const code = searchParams.get('code')
cookies().set('code', code)

const redirectUrl = new URL(request.url)
return redirect(redirectUrl.origin)
}
26 changes: 25 additions & 1 deletion app/fragments/app-registration/src/registration.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import { useTheme } from '@emotion/react'

import React from 'react'
// @ts-ignore:next-line
import { useRouter } from 'next/navigation'
import { useIntl } from 'react-intl'

import { MainLogo } from '@app/main-logo'
Expand All @@ -17,12 +19,34 @@ import { ThemeType } from '@ui/theme'
const Registration: React.FC = () => {
const theme = useTheme() as ThemeType
const { formatMessage } = useIntl()

const router = useRouter()

const currentUrl = new URL(window.location.href)

const gitHubAuthBaseUrl = 'https://github.com/login/oauth/authorize'
const gitHubAuthUrl = new URL('', gitHubAuthBaseUrl)

if (!process.env.NEXT_PUBLIC_GH_CLIENT_ID) throw new Error('need github cliend id')
gitHubAuthUrl.searchParams.set('client_id', process.env.NEXT_PUBLIC_GH_CLIENT_ID)

gitHubAuthUrl.searchParams.set('redirect_uri', `${currentUrl.origin}/api/github`)

const authButtonClickHandler = async () => {
router.replace(gitHubAuthUrl.href)
}
Nelfimov marked this conversation as resolved.
Show resolved Hide resolved

return (
<Background backgroundUrl='url(/Bg.png)'>
<Column margin={theme.spaces.tb180lra} height='auto'>
<MainLogo />
<Box justifyContent='center'>
<Button variant='blackBackgroundButton' shape='rectangle' size='bigRoundedPadding'>
<Button
variant='blackBackgroundButton'
shape='rectangle'
size='bigRoundedPadding'
onClick={authButtonClickHandler}
>
<GitHubIcon width={theme.spaces.bigDecreased} height={theme.spaces.bigDecreased} />
<Text
fontSize={theme.fontSizes.normal.semiIncreased}
Expand Down
Loading