-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
294 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Test OAuth | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-google-oauth: | ||
runs-on: ubuntu-latest | ||
env: | ||
########################################################################## | ||
# App Config | ||
########################################################################## | ||
NEXT_PUBLIC_URL: "http://localhost:3000" | ||
DATABASE_URI: "file:./payload-oauth2.db" | ||
PAYLOAD_SECRET: "hellohereisasecretforyou" | ||
|
||
########################################################################## | ||
# Google OAuth Config | ||
########################################################################## | ||
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | ||
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | ||
|
||
########################################################################## | ||
# Test Config | ||
########################################################################## | ||
# Optional: Set to "true" to run test browser in headless mode | ||
HEADLESS: true | ||
|
||
########################################################################## | ||
# Google Test Account | ||
########################################################################## | ||
# Required: Google Test Account Email | ||
GOOGLE_TEST_EMAIL: ${{ secrets.GOOGLE_TEST_EMAIL }} | ||
|
||
# Required: Google Test Account Password | ||
GOOGLE_TEST_PASSWORD: ${{ secrets.GOOGLE_TEST_PASSWORD }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 9 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
cache: "pnpm" | ||
- run: | | ||
pnpx puppeteer browsers install chrome | ||
- run: pnpm install | ||
- run: pnpm test | ||
test-zitadel-oauth: | ||
runs-on: ubuntu-latest | ||
env: | ||
########################################################################## | ||
# App Config | ||
########################################################################## | ||
NEXT_PUBLIC_URL: "http://localhost:3000" | ||
DATABASE_URI: "file:./payload-oauth2.db" | ||
PAYLOAD_SECRET: "hellohereisasecretforyou" | ||
|
||
########################################################################## | ||
# Zitadel OAuth Config | ||
########################################################################## | ||
ZITADEL_CLIENT_ID: ${{ secrets.ZITADEL_CLIENT_ID }} | ||
ZITADEL_CLIENT_SECRET: ${{ secrets.ZITADEL_CLIENT_SECRET }} | ||
ZITADEL_TOKEN_ENDPOINT: ${{ secrets.ZITADEL_TOKEN_ENDPOINT }} | ||
ZITADEL_AUTHORIZATION_URL: ${{ secrets.ZITADEL_AUTHORIZATION_URL }} | ||
ZITADEL_USERINFO_ENDPOINT: ${{ secrets.ZITADEL_USERINFO_ENDPOINT }} | ||
|
||
########################################################################## | ||
# Test Config | ||
########################################################################## | ||
# Optional: Set to "true" to run test browser in headless mode | ||
HEADLESS: true | ||
|
||
########################################################################## | ||
# Zitadel Test Account | ||
########################################################################## | ||
# Required: Zitadel Test Account Email | ||
ZITADEL_TEST_EMAIL: ${{ secrets.ZITADEL_TEST_EMAIL }} | ||
|
||
# Required: Zitadel Test Account Password | ||
ZITADEL_TEST_PASSWORD: ${{ secrets.ZITADEL_TEST_PASSWORD }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 9 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
cache: "pnpm" | ||
- run: | | ||
pnpx puppeteer browsers install chrome | ||
- run: pnpm install | ||
- run: pnpm test |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import { OAuthLoginButton as OAuthLoginButton_cd47d145aed4cb23589a094917bd46e9 } from 'src/components/OAuthLoginButton' | ||
import { GoogleOAuthLoginButton as GoogleOAuthLoginButton_143f92647bcb7528bfe1082a22fc4d4e } from 'src/components/GoogleOAuthLoginButton' | ||
import { ZitadelOAuthLoginButton as ZitadelOAuthLoginButton_2b344d0256ae0172631ef421761722bb } from 'src/components/ZitadelOAuthLoginButton' | ||
|
||
export const importMap = { | ||
"src/components/OAuthLoginButton#OAuthLoginButton": OAuthLoginButton_cd47d145aed4cb23589a094917bd46e9 | ||
"src/components/GoogleOAuthLoginButton#GoogleOAuthLoginButton": GoogleOAuthLoginButton_143f92647bcb7528bfe1082a22fc4d4e, | ||
"src/components/ZitadelOAuthLoginButton#ZitadelOAuthLoginButton": ZitadelOAuthLoginButton_2b344d0256ae0172631ef421761722bb | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use client"; | ||
export const GoogleOAuthLoginButton: React.FC = () => ( | ||
<a href="/api/users/oauth/google"> | ||
<button | ||
className="btn btn--icon-style-without-border btn--size-large btn--withoutPopup btn--style-primary btn--withoutPopup" | ||
style={{ width: "100%" }} | ||
> | ||
Continue With Google | ||
</button> | ||
</a> | ||
); |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use client"; | ||
export const ZitadelOAuthLoginButton: React.FC = () => ( | ||
<a href="/api/users/oauth/zitadel"> | ||
<button | ||
className="btn btn--icon-style-without-border btn--size-large btn--withoutPopup btn--style-primary btn--withoutPopup" | ||
style={{ width: "100%" }} | ||
> | ||
Continue With Zitadel | ||
</button> | ||
</a> | ||
); |
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
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
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
Oops, something went wrong.