Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
6 changes: 3 additions & 3 deletions app/components/Header/AuthModal.client.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script setup lang="ts">
const handleInput = shallowRef('')

const route = useRoute()
const { user, logout } = useAtproto()

async function handleBlueskySignIn() {
await navigateTo(
{
path: '/api/auth/atproto',
query: { handle: 'https://bsky.social' },
query: { handle: 'https://bsky.social', returnTo: route.fullPath },
},
{ external: true },
)
Expand All @@ -17,7 +17,7 @@ async function handleCreateAccount() {
await navigateTo(
{
path: '/api/auth/atproto',
query: { handle: 'https://npmx.social', create: 'true' },
query: { handle: 'https://npmx.social', create: 'true', returnTo: route.fullPath },
},
{ external: true },
)
Expand Down
1 change: 1 addition & 0 deletions app/pages/package-docs/[...path].vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ const showEmptyState = computed(() => docsData.value?.status !== 'ok')
/* Individual symbol articles */
.docs-content .docs-symbol {
@apply mb-10 pb-10 border-b border-border/30 last:border-0;
word-break: break-word;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it have to do with the described fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was working on another issue and forgot to switch branches. Please ignore that commit for now

Comment thread
danielroe marked this conversation as resolved.
Outdated
}

.docs-content .docs-symbol:target {
Expand Down
14 changes: 13 additions & 1 deletion server/api/auth/atproto.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ export default defineEventHandler(async event => {
}

const query = getQuery(event)
const returnTo = query.returnTo?.toString() || '/'

setCookie(event, 'auth_return_to', returnTo, {
maxAge: 60 * 5,
httpOnly: true,
// secure only if NOT in dev mode
secure: !import.meta.dev,
})
Comment thread
NandkishorJadoun marked this conversation as resolved.
Outdated

const clientMetadata = getOauthClientMetadata()
const { stateStore, sessionStore } = useOAuthStorage(event)

Expand Down Expand Up @@ -60,5 +69,8 @@ export default defineEventHandler(async event => {

await session.update(miniDoc)

return sendRedirect(event, '/')
const returnToURL = getCookie(event, 'auth_return_to') || '/'
deleteCookie(event, 'auth_return_to')

return sendRedirect(event, returnToURL)
})
Loading