Skip to content

Commit

Permalink
fix: origin
Browse files Browse the repository at this point in the history
  • Loading branch information
stagas committed Oct 4, 2024
1 parent c6a5412 commit 5c98db9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/routes/oauth/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export function mount(app: Router) {
Object.fromEntries(ctx.url.searchParams.entries())
)

const origin = (
const { origin } = new URL((
ctx.request.headers.get('referer') ??
env.WEB_URL
).replace(/\/$/, '')
))

ctx.log('OAuth origin:', origin)

Expand Down
1 change: 0 additions & 1 deletion src/pages/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export function App() {
case '/oauth/popup': {

Check warning on line 44 in src/pages/App.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/App.tsx#L44

Added line #L44 was not covered by tests
const provider = state.url.searchParams.get('provider')!
const url = new URL(`${env.VITE_API_URL}/oauth/start`)
url.searchParams.set('origin', location.origin)
url.searchParams.set('provider', provider)
location.href = url.href

Check warning on line 48 in src/pages/App.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/App.tsx#L46-L48

Added lines #L46 - L48 were not covered by tests
return <div />
Expand Down

0 comments on commit 5c98db9

Please sign in to comment.