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

refactor(server): auth #5895

Merged
merged 1 commit into from
Mar 12, 2024
Merged

refactor(server): auth #5895

merged 1 commit into from
Mar 12, 2024

Conversation

forehalo
Copy link
Member

@forehalo forehalo commented Feb 23, 2024

Remove next-auth and implement our own Authorization/Authentication system from scratch.

Server

  • tokens

    • function
    • encryption
  • AuthController

    • /api/auth/sign-in
    • /api/auth/sign-out
    • /api/auth/session
    • /api/auth/session (WE SUPPORT MULTI-ACCOUNT!)
  • OAuthPlugin

    • OAuthController
    • /oauth/login
    • /oauth/callback
    • Providers
      • Google
      • GitHub

Client

  • useSession
  • cloudSignIn
  • cloudSignOut

NOTE:

Tests will be adding in the future

Copy link
Member Author

forehalo commented Feb 23, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @forehalo and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added app:electron Related to electron app test Related to test cases labels Feb 26, 2024
Copy link

nx-cloud bot commented Feb 26, 2024

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 54.88880% with 1075 lines in your changes are missing coverage. Please review.

Project coverage is 61.10%. Comparing base (af49e8c) to head (fb3a0e7).

Files Patch % Lines
...ges/backend/server/src/plugins/oauth/controller.ts 17.82% 189 Missing ⚠️
...ackages/backend/server/src/core/auth/controller.ts 31.13% 146 Missing ⚠️
packages/backend/server/src/core/auth/service.ts 48.21% 145 Missing ⚠️
packages/backend/server/src/core/auth/resolver.ts 49.18% 92 Missing and 1 partial ⚠️
...ckend/server/src/plugins/oauth/providers/google.ts 30.57% 84 Missing ⚠️
...ckend/server/src/plugins/oauth/providers/github.ts 30.97% 78 Missing ⚠️
packages/frontend/native/index.js 0.00% 32 Missing ⚠️
packages/backend/server/src/core/user/service.ts 72.32% 30 Missing and 1 partial ⚠️
packages/backend/server/src/core/user/resolver.ts 40.81% 29 Missing ⚠️
...ges/backend/server/src/fundamentals/helpers/url.ts 48.14% 27 Missing and 1 partial ⚠️
... and 24 more
Additional details and impacted files
@@            Coverage Diff             @@
##           canary    #5895      +/-   ##
==========================================
- Coverage   61.45%   61.10%   -0.36%     
==========================================
  Files         475      487      +12     
  Lines       21375    21928     +553     
  Branches     1896     1922      +26     
==========================================
+ Hits        13136    13399     +263     
- Misses       8017     8306     +289     
- Partials      222      223       +1     
Flag Coverage Δ
server-test 70.43% <56.34%> (-0.61%) ⬇️
unittest 40.05% <9.45%> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@forehalo forehalo force-pushed the 61/refactor-auth branch 3 times, most recently from cbce858 to fa146ef Compare March 1, 2024 09:35
@darkskygit darkskygit force-pushed the 61/refactor-auth branch 3 times, most recently from 7396b58 to d507e40 Compare March 5, 2024 10:35
@github-actions github-actions bot added the docs Improvements or additions to documentation label Mar 5, 2024
@forehalo forehalo force-pushed the 61/refactor-auth branch 6 times, most recently from 7df6e3c to f7226c0 Compare March 11, 2024 07:24
Copy link
Collaborator

pengx17 commented Mar 11, 2024

image.png

graphql postinstall failed

@EYHN EYHN linked an issue Mar 11, 2024 that may be closed by this pull request
@forehalo
Copy link
Member Author

image.png

graphql postinstall failed

fixed

@forehalo forehalo marked this pull request as ready for review March 12, 2024 03:16
Copy link

graphite-app bot commented Mar 12, 2024

Merge activity

Remove `next-auth` and implement our own Authorization/Authentication system from scratch.

## Server

- [x] tokens
  - [x] function
  - [x] encryption

- [x] AuthController
  - [x] /api/auth/sign-in
  - [x] /api/auth/sign-out
  - [x] /api/auth/session
  - [x] /api/auth/session (WE SUPPORT MULTI-ACCOUNT!)

- [x] OAuthPlugin
  - [x] OAuthController
  - [x] /oauth/login
  - [x] /oauth/callback
  - [x] Providers
    - [x] Google
    - [x] GitHub

## Client

- [x] useSession
- [x] cloudSignIn
- [x] cloudSignOut

## NOTE:

Tests will be adding in the future
@graphite-app graphite-app bot merged commit fb3a0e7 into canary Mar 12, 2024
39 of 43 checks passed
@graphite-app graphite-app bot deleted the 61/refactor-auth branch March 12, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:core app:electron Related to electron app app:server docs Improvements or additions to documentation mod:component mod:i18n Related to i18n mod:native mod:store mod:workspace-impl test Related to test cases
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Migrate next-auth to @auth/core
5 participants