mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
<!--
Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md
-->
<!-- RECURSEML_SUMMARY:START -->
## High-level PR Summary
This PR fixes dependency management issues by adding the missing
`wait-on` package to the Convex example's dependencies, reorganizing the
dependency order in `package.json` for consistency, and regenerating the
`pnpm-lock.yaml` file to ensure proper dependency resolution across the
monorepo.
⏱️ Estimated Review Time: 5-15 minutes
<details>
<summary>💡 Review Order Suggestion</summary>
| Order | File Path |
|-------|-----------|
| 1 | `examples/convex/package.json` |
| 2 | `pnpm-lock.yaml` |
</details>
[](https://discord.gg/n3SsVDAW6U)
[
<!-- RECURSEML_SUMMARY:END -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added UI buttons to view user info via different clients, a
server-side user info section, and an Action page to view/submit updates
to user metadata.
- Added a server-side action to update a user's client-read-only
metadata.
- **Documentation**
- In-app link and guidance to the Action route for updating user data.
- **Chores**
- Updated project dependencies/devDependencies and added .env.local to
.gitignore.
- **Bug Fixes**
- Token-missing scenario now handled gracefully instead of throwing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
22 lines
852 B
TypeScript
22 lines
852 B
TypeScript
import { api } from "@/convex/_generated/api";
|
|
import { stackClientApp } from "@/stack/client";
|
|
import { ConvexHttpClient, ConvexClient } from "convex/browser";
|
|
|
|
const convexHttpClient = new ConvexHttpClient(process.env.NEXT_PUBLIC_CONVEX_URL!);
|
|
|
|
export async function getUserInfoConvexHttpClient() {
|
|
const token = await stackClientApp.getConvexHttpClientAuth({ tokenStore: "nextjs-cookie" });
|
|
convexHttpClient.setAuth(token);
|
|
const userInfo = await convexHttpClient.query(api.myFunctions.getUserInfo, {});
|
|
return userInfo;
|
|
}
|
|
|
|
|
|
const convexClient = new ConvexClient(process.env.NEXT_PUBLIC_CONVEX_URL!);
|
|
convexClient.setAuth(stackClientApp.getConvexClientAuth({ tokenStore: "nextjs-cookie" }))
|
|
|
|
export async function getUserInfoConvexClient() {
|
|
const userInfo = await convexClient.query(api.myFunctions.getUserInfo, {});
|
|
return userInfo;
|
|
}
|