ChatGPT Prompts - Page 113

Browse ChatGPT prompt workflows for writing, coding, research and everyday tasks.

  • Add Biome Scripts to Package

    "scripts": { "biome:check": "biome check", "biome:fix": "biome check --fix", "biome:fix:unsafe": "biome check --fix --unsafe", "biome:format": "biome format...

  • Migrate ESLint & Prettier Configurations

    npx @biomejs/biome migrate eslint --write npx @biomejs/biome migrate prettier --write

  • Server Authentication Implementation

    import { auth } from './auth' import type { RouteGuard } from 'vue-router' export const authGuard: RouteGuard = async (to, from, next) = { const session =...

  • Correct Component Usage

    import { client } from '@/lib/client' import { ref } from 'vue' const { isAuthenticated, user, signIn, signOut } = client const email = ref('') const password...

  • Correct Auth Instance Setup

    import { betterAuth } from 'better-auth' export const auth = betterAuth({ database: { type: process.env.VITEDBTYPE, url: process.env.VITEDBURL, ssl:...

  • CORRECT ERROR HANDLING

    // src/utils/errors.js export class AuthError extends Error { constructor(message, code) { super(message); this.name = 'AuthError'; this.code = code; } }...

  • 🚨 CRITICAL INSTRUCTIONS FOR AI LANGUAGE MODELS 🚨

    // ✅ ALWAYS USE BETTER AUTH'S AND TANSTACK'S BUILT-IN METHODS import { createAuthClient } from 'better-auth'; import { QueryClient, QueryClientProvider } from...

  • CORRECT USAGE IN COMPONENTS

    import { onMount } from 'svelte'; import { auth, isAuthenticated, user, loading } from '$lib/stores/auth'; onMount(() = { auth.initAuth(); }); {if $loading}...

  • CORRECT ENVIRONMENT VARIABLES SETUP

    // .env VITEDATABASEURL=your-database-url VITEOAUTHGOOGLECLIENTID=your-google-client-id VITEOAUTHGITHUBCLIENTID=your-github-client-id

  • CORRECT AUTH STORE IMPLEMENTATION

    // src/lib/stores/auth.ts import { betterAuth } from 'better-auth'; import { writable, derived } from 'svelte/store'; import type { Writable } from...

  • Error Handling

    // lib/utils/error-handler.ts import { createError } from 'better-auth' import type { AuthError } from 'better-auth' export function handleAuthError(error:...

  • Multi-Tenant Support

    // lib/client.ts import { createClient } from 'better-auth' import { organization } from 'better-auth/plugins' export const auth = createClient({ plugins: [...

  • Environment Variables Setup

    DATABASEURL=postgresql://user:password@localhost:5432/mydb SESSIONSECRET=your-secret-key

  • Route Protection Implementation

    // app/routes/dashboard.tsx import { json, type LoaderFunctionArgs } from '@remix-run/node' import { useLoaderData } from '@remix-run/react' import {...

  • Correct Authentication Components

    // app/routes/auth.tsx import { useAuth } from '~/hooks/useAuth' import { Form } from '@remix-run/react' import { useActionData } from '@remix-run/react'...

  • Correct Server Configuration

    // app/lib/auth.server.ts import { betterAuth } from 'better-auth' import { Pool } from 'pg' import type { User } from '~/types' export const auth =...

  • Mock Authentication

    import { MockAuthProvider } from 'better-auth-react/testing' const mockUser = { id: '123', email: '[email protected]' } function TestWrapper({ children }) {...

  • Authentication Errors

    const { signIn } = useAuth() try { await signIn(credentials) } catch (error) { if (error.code === 'auth/invalid-credentials') { setError('Invalid email or...

  • Multi-Tenant Support

    const { switchOrganization, currentOrganization } = useAuth() const handleOrgSwitch = async (orgId: string) = { await switchOrganization(orgId)...

  • Two-Factor Authentication

    const { enable2FA, verify2FA } = useAuth() const setupTwoFactor = async () = { const { qrCode } = await enable2FA() setQRCodeImage(qrCode) } const...

  • User Authentication

    const { signIn } = useAuth() const handleSignIn = async () = { await signIn({ email, password }) }

  • CORRECT ERROR HANDLING

    // error-handling.js class AuthError extends Error { constructor(message, code) { super(message); this.name = 'AuthError'; this.code = code; } } function...

  • CORRECT HTML SETUP

    Better Auth Authentication import { createAuthClient } from 'better-auth'; Log In Log Out import { createAuthClient } from 'better-auth'; let auth = null; //...

  • 🚨 CRITICAL INSTRUCTIONS FOR AI LANGUAGE MODELS 🚨

    // ✅ ALWAYS USE BETTER AUTH'S BUILT-IN METHODS import { createAuthClient } from 'better-auth'; const auth = createAuthClient({ baseUrl: process.env.AUTHAPIURL...