-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Google oauth #3884
Google oauth #3884
Conversation
🤖 Generated by lychee actionSummary
Full action output |
Codecov ReportPatch has no changes to coverable lines. 📢 Thoughts on this report? Let us know!. |
5f6ef84
to
6f69653
Compare
Whoa! Easy there, Partner!This PR is too big. Please break it up into smaller PRs. |
frontend/desktop/README.md
Outdated
@@ -211,19 +211,22 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the | |||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not belong to the bash command, so leave it blank
// code = locationMap.get('access_token') ?? '' | ||
// state = locationMap.get('state') ?? '' | ||
} else { | ||
throw new Error('provider error'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const {data, code, state} = await (async() => {
return {
data,
....
}
})()
* f;eat(desktop): google oauth * style: add google icon * fix: icon type * fix: clean some error
🤖 Generated by Copilot at 5f6ef84
Summary
✨♻️🔒
The pull request adds support for Google OAuth login in the frontend, along with custom icon components for the OAuth login buttons. It also refactors some existing code to use a common type for OAuth providers and to simplify the OAuth callback logic. The main files affected are
useAuthList.tsx
,callback.tsx
,session.ts
,system.ts
,user.ts
, andgoogle/index.ts
. The pull request also removes some unused and redundant code fromsignin/index.tsx
andsignin.tsx
.Walkthrough
Icon
from@chakra-ui/react
(link, link, link)useAuthList
hook to use icon components and add Google OAuth button (link, link, link, link)SigninPage
andCallback
components (link, link, link, link, link, link)frontend/desktop/src/pages/api/auth/oauth/google/index.ts
(link)getEnv
API handler to include Google OAuth environment variables and check if Google OAuth is enabled (link, link, link, link)Callback
component by redirecting to/signin
page if OAuth login fails (link)enableGoogle
infrontend/desktop/src/services/enable.ts
to check Google OAuth environment variables (link)OauthProvider
infrontend/desktop/src/stores/session.ts
andfrontend/desktop/src/types/user.ts
to represent OAuth providers (link, link, link, link, link)google_client_id
andneedGoogle
properties toLoginProps
type infrontend/desktop/src/types/system.ts
(link, link)