Got it running with sentry and plausible and stuff. Auth seems good
This commit is contained in:
@@ -2,7 +2,7 @@ export default {
|
||||
providers: [
|
||||
{
|
||||
domain: process.env.CONVEX_SITE_URL,
|
||||
applicationID: "convex",
|
||||
applicationID: 'convex',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Password } from "@convex-dev/auth/providers/Password";
|
||||
import { convexAuth } from "@convex-dev/auth/server";
|
||||
import { Password } from '@convex-dev/auth/providers/Password';
|
||||
import { convexAuth } from '@convex-dev/auth/server';
|
||||
|
||||
export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
|
||||
providers: [Password],
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { httpRouter } from "convex/server";
|
||||
import { auth } from "./auth";
|
||||
import { httpRouter } from 'convex/server';
|
||||
import { auth } from './auth';
|
||||
|
||||
const http = httpRouter();
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { v } from "convex/values";
|
||||
import { query, mutation, action } from "./_generated/server";
|
||||
import { api } from "./_generated/api";
|
||||
import { getAuthUserId } from "@convex-dev/auth/server";
|
||||
import { v } from 'convex/values';
|
||||
import { query, mutation, action } from './_generated/server';
|
||||
import { api } from './_generated/api';
|
||||
import { getAuthUserId } from '@convex-dev/auth/server';
|
||||
|
||||
// Write your Convex functions in any file inside this directory (`convex`).
|
||||
// See https://docs.convex.dev/functions for more.
|
||||
@@ -18,9 +18,9 @@ export const listNumbers = query({
|
||||
//// Read the database as many times as you need here.
|
||||
//// See https://docs.convex.dev/database/reading-data.
|
||||
const numbers = await ctx.db
|
||||
.query("numbers")
|
||||
.query('numbers')
|
||||
// Ordered by _creationTime, return most recent
|
||||
.order("desc")
|
||||
.order('desc')
|
||||
.take(args.count);
|
||||
const userId = await getAuthUserId(ctx);
|
||||
const user = userId === null ? null : await ctx.db.get(userId);
|
||||
@@ -44,9 +44,9 @@ export const addNumber = mutation({
|
||||
//// Mutations can also read from the database like queries.
|
||||
//// See https://docs.convex.dev/database/writing-data.
|
||||
|
||||
const id = await ctx.db.insert("numbers", { value: args.value });
|
||||
const id = await ctx.db.insert('numbers', { value: args.value });
|
||||
|
||||
console.log("Added new document with id:", id);
|
||||
console.log('Added new document with id:', id);
|
||||
// Optionally, return a value from your mutation.
|
||||
// return id;
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { defineSchema, defineTable } from "convex/server";
|
||||
import { v } from "convex/values";
|
||||
import { authTables } from "@convex-dev/auth/server";
|
||||
import { defineSchema, defineTable } from 'convex/server';
|
||||
import { v } from 'convex/values';
|
||||
import { authTables } from '@convex-dev/auth/server';
|
||||
|
||||
// The schema is normally optional, but Convex Auth
|
||||
// requires indexes defined on `authTables`.
|
||||
|
Reference in New Issue
Block a user