feat: add better provider support, icons, regen, and a lot more

This commit is contained in:
Zoe
2026-02-12 14:56:13 +00:00
parent d5a5945c03
commit d29f95bacf
124 changed files with 6374 additions and 1861 deletions
+11 -6
View File
@@ -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,
});
}
},
});