feat: add better provider support, icons, regen, and a lot more
This commit is contained in:
@@ -8,10 +8,16 @@ export default defineNuxtPlugin({
|
||||
|
||||
nuxtApp.hook('app:mounted', async () => {
|
||||
if (!session.value) {
|
||||
await fetchSession();
|
||||
const result = await fetchSession();
|
||||
if (!result.ok) {
|
||||
console.warn('Failed to fetch session:', result.error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!session.value) return;
|
||||
if (!session.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ('startSession' in triplit) {
|
||||
await triplit.startSession(session.value.token);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { assert } from "~~/utils/assert";
|
||||
|
||||
export default defineNuxtPlugin({
|
||||
name: 'better-auth-fetch-plugin',
|
||||
enforce: 'pre',
|
||||
@@ -10,16 +12,19 @@ export default defineNuxtPlugin({
|
||||
const { session, fetchSession } = useAuth();
|
||||
|
||||
if (!session.value) {
|
||||
await fetchSession();
|
||||
const result = await fetchSession();
|
||||
if (!result.ok) {
|
||||
console.error('Failed to fetch session:', result.error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!session.value) return;
|
||||
|
||||
if ('updateOptions' in triplit) {
|
||||
triplit.updateOptions({
|
||||
token: session.value.token,
|
||||
});
|
||||
}
|
||||
assert('updateOptions' in triplit);
|
||||
triplit.updateOptions({
|
||||
token: session.value.token,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2,13 +2,17 @@ import { unified } from 'unified';
|
||||
import remarkParse from 'remark-parse';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
import remarkRehype from 'remark-rehype';
|
||||
import remarkMath from 'remark-math';
|
||||
import rehypeKatex from 'rehype-katex';
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
const remark =
|
||||
unified()
|
||||
.use(remarkParse)
|
||||
.use(remarkGfm)
|
||||
.use(remarkRehype, { allowDangerousHtml: true });
|
||||
.use(remarkMath, { singleDollarTextMath: false })
|
||||
.use(remarkRehype, { allowDangerousHtml: true })
|
||||
.use(rehypeKatex);
|
||||
|
||||
return {
|
||||
provide: {
|
||||
|
||||
Reference in New Issue
Block a user