mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
published npm pacakges
This commit is contained in:
parent
4536d67268
commit
5d43e48248
11
.changeset/config.json
Normal file
11
.changeset/config.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
@ -16,8 +16,8 @@
|
||||
"next-themes": "^0.2.1",
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"stack": "workspace:*",
|
||||
"stack-shared": "workspace:*"
|
||||
"@stackframe/stack": "workspace:*",
|
||||
"@stackframe/stack-shared": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.2.23",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { StackHandler } from "stack";
|
||||
import { StackHandler } from "@stackframe/stack";
|
||||
import { stackServerApp } from "src/stack";
|
||||
|
||||
export default function Handler(props) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import Link from "next/link";
|
||||
import { Metadata } from "next";
|
||||
import { StackProvider } from "stack";
|
||||
import { StackProvider } from "@stackframe/stack";
|
||||
import { stackServerApp } from "src/stack";
|
||||
import Provider from "src/components/Provider";
|
||||
import ColorMode from "src/components/ColorMode";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import "server-only";
|
||||
|
||||
import { StackServerApp } from "stack";
|
||||
import { StackServerApp } from "@stackframe/stack";
|
||||
|
||||
export const stackServerApp = new StackServerApp({
|
||||
tokenStore: "nextjs-cookie",
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
"next-themes": "^0.2.1",
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"stack": "workspace:*",
|
||||
"stack-shared": "workspace:*"
|
||||
"@stackframe/stack": "workspace:*",
|
||||
"@stackframe/stack-shared": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.2.23",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { StackHandler } from "stack";
|
||||
import { StackHandler } from "@stackframe/stack";
|
||||
import { stackServerApp } from "src/stack";
|
||||
|
||||
export default function Handler(props) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { StackProvider } from "stack";
|
||||
import { StackProvider } from "@stackframe/stack";
|
||||
import { stackServerApp } from "src/stack";
|
||||
import Provider from "src/components/Provider";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
'use client';
|
||||
import { useUser } from "stack";
|
||||
import { useUser } from "@stackframe/stack";
|
||||
|
||||
export default function ProtectedPage() {
|
||||
useUser({ or: 'redirect' });
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
'use client';
|
||||
import { useStackApp, validateEmail } from "stack";
|
||||
import { useStackApp, validateEmail } from "@stackframe/stack";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function CustomCredentialSignIn() {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
'use client';
|
||||
import { useStackApp } from "stack";
|
||||
import { useStackApp } from "@stackframe/stack";
|
||||
|
||||
export default function CustomOAuthSignIn() {
|
||||
const app = useStackApp();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { SignIn } from "stack";
|
||||
import { SignIn } from "@stackframe/stack";
|
||||
import { stackServerApp } from "src/stack";
|
||||
import CustomCredentialSignIn from "./custom-credential";
|
||||
import CustomOAuthSignIn from "./custom-oauth";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useUser, useStackApp } from "stack";
|
||||
import { runAsynchronously } from "stack-shared/dist/utils/promises";
|
||||
import { useUser, useStackApp } from "@stackframe/stack";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
|
||||
export default function SignOutButton() {
|
||||
const user = useUser();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useUser } from "stack";
|
||||
import { useUser } from "@stackframe/stack";
|
||||
|
||||
export default function UserInfoClient() {
|
||||
const user = useUser();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import "server-only";
|
||||
|
||||
import { StackServerApp } from "stack";
|
||||
import { StackServerApp } from "@stackframe/stack";
|
||||
|
||||
export const stackServerApp = new StackServerApp({
|
||||
tokenStore: "nextjs-cookie",
|
||||
|
||||
@ -8,7 +8,7 @@ sidebar_position: 1
|
||||
|
||||
```tsx
|
||||
'use client';
|
||||
import { useStackApp, SignIn } from "stack";
|
||||
import { useStackApp, SignIn } from "@stackframe/stack";
|
||||
|
||||
export default function DefaultSignIn() {
|
||||
const app = useStackApp();
|
||||
@ -24,7 +24,7 @@ export default function DefaultSignIn() {
|
||||
|
||||
```tsx
|
||||
'use client';
|
||||
import { useStackApp } from "stack";
|
||||
import { useStackApp } from "@stackframe/stack";
|
||||
|
||||
export default function CustomOAuthSignIn() {
|
||||
const app = useStackApp();
|
||||
|
||||
13
package.json
13
package.json
@ -8,18 +8,21 @@
|
||||
"build": "turbo build",
|
||||
"clean": "turbo run clean --no-cache",
|
||||
"codegen": "turbo run codegen --no-cache",
|
||||
"prisma:server": "pnpm run --filter=stack-server prisma",
|
||||
"prisma:server": "pnpm run --filter=@stackframe/stack-server prisma",
|
||||
"dev": "turbo run dev --parallel --continue",
|
||||
"dev:app": "turbo run dev --parallel --continue --filter=dev-app...",
|
||||
"dev:server": "turbo run dev --parallel --continue --filter=stack-server...",
|
||||
"dev:email": "turbo run dev --parallel --continue --filter=stack-email...",
|
||||
"dev:app": "turbo run dev --parallel --continue --filter=@stackframe/dev-app...",
|
||||
"dev:server": "turbo run dev --parallel --continue --filter=@stackframe/stack-server...",
|
||||
"dev:email": "turbo run email --parallel --continue --filter=@stackframe/stack-server...",
|
||||
"docs": "turbo run dev --parallel --continue --filter=stack-docs...",
|
||||
"lint": "turbo run lint --no-cache -- --max-warnings=0",
|
||||
"prettier": "prettier --check .",
|
||||
"prettier:format": "prettier --write .",
|
||||
"release": "release",
|
||||
"peek": "pnpm release --peek"
|
||||
"peek": "pnpm release --peek",
|
||||
"changeset": "changeset"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.27.1",
|
||||
"@types/node": "^20.8.10",
|
||||
"@typescript-eslint/eslint-plugin": "^6.x",
|
||||
"@typescript-eslint/parser": "^6.x",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "stack-server",
|
||||
"name": "@stackframe/stack-server",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@ -64,8 +64,8 @@
|
||||
"remark-math": "^6",
|
||||
"server-only": "^0.0.1",
|
||||
"sharp": "^0.32.6",
|
||||
"stack": "workspace:*",
|
||||
"stack-shared": "workspace:*",
|
||||
"@stackframe/stack": "workspace:*",
|
||||
"@stackframe/stack-shared": "workspace:*",
|
||||
"yup": "^1.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { AccordionGroup, Card, CardOverflow } from "@mui/joy";
|
||||
import { use } from "react";
|
||||
import { Paragraph } from "@/components/paragraph";
|
||||
import { useStrictMemo } from "stack-shared/src/hooks/use-strict-memo";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/src/hooks/use-strict-memo";
|
||||
import { SmartSwitch } from "@/components/smart-switch";
|
||||
import { SimpleCard } from "@/components/simple-card";
|
||||
import { useAdminApp } from "../../useAdminInterface";
|
||||
|
||||
@ -6,7 +6,7 @@ import { Paragraph } from "@/components/paragraph";
|
||||
import { Icon } from "@/components/icon";
|
||||
import { Dialog } from "@/components/dialog";
|
||||
import { AsyncButton } from "@/components/async-button";
|
||||
import { useStrictMemo } from "stack-shared/src/hooks/use-strict-memo";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/src/hooks/use-strict-memo";
|
||||
import { SimpleCard } from "@/components/simple-card";
|
||||
import { useAdminApp } from "../../useAdminInterface";
|
||||
|
||||
|
||||
@ -13,9 +13,9 @@ import {
|
||||
FormLabel,
|
||||
Input,
|
||||
} from "@mui/joy";
|
||||
import { OauthProviderConfigJson } from "stack-shared";
|
||||
import { OauthProviderConfigJson } from "@stackframe/stack-shared";
|
||||
import { useState } from "react";
|
||||
import { typedIncludes } from "stack-shared/dist/utils/arrays";
|
||||
import { typedIncludes } from "@stackframe/stack-shared/dist/utils/arrays";
|
||||
import { Paragraph } from "@/components/paragraph";
|
||||
import { AsyncButton } from "@/components/async-button";
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { use, useState } from "react";
|
||||
import { Paragraph } from "@/components/paragraph";
|
||||
import { useStrictMemo } from "stack-shared/src/hooks/use-strict-memo";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/src/hooks/use-strict-memo";
|
||||
import { UsersTable } from "./users-table";
|
||||
import { useAdminApp } from "../../useAdminInterface";
|
||||
|
||||
|
||||
@ -22,13 +22,13 @@ import {
|
||||
ModalDialog,
|
||||
Stack,
|
||||
} from '@mui/joy';
|
||||
import { fromNowDetailed, getInputDatetimeLocalString } from 'stack-shared/dist/utils/dates';
|
||||
import { fromNowDetailed, getInputDatetimeLocalString } from '@stackframe/stack-shared/dist/utils/dates';
|
||||
import { Icon } from '@/components/icon';
|
||||
import { AsyncButton } from '@/components/async-button';
|
||||
import { Dialog } from '@/components/dialog';
|
||||
import { useAdminApp } from '../../useAdminInterface';
|
||||
import { runAsynchronously } from 'stack-shared/src/utils/promises';
|
||||
import { ServerUserJson } from 'stack-shared';
|
||||
import { runAsynchronously } from '@stackframe/stack-shared/src/utils/promises';
|
||||
import { ServerUserJson } from '@stackframe/stack-shared';
|
||||
import Table from '@/components/table';
|
||||
|
||||
export function UsersTable(props: {
|
||||
|
||||
@ -6,8 +6,8 @@ import Box from '@mui/joy/Box';
|
||||
import IconButton from '@mui/joy/IconButton';
|
||||
import { useAdminApp } from './useAdminInterface';
|
||||
import { redirect, usePathname } from 'next/navigation';
|
||||
import { useStrictMemo } from 'stack-shared/src/hooks/use-strict-memo';
|
||||
import { useStackApp } from 'stack';
|
||||
import { useStrictMemo } from '@stackframe/stack-shared/src/hooks/use-strict-memo';
|
||||
import { useStackApp } from '@stackframe/stack';
|
||||
import { Icon } from '@/components/icon';
|
||||
import Breadcrumbs from '@mui/joy/Breadcrumbs';
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Dialog } from "@/components/dialog";
|
||||
import { use, useId, useRef, useState } from "react";
|
||||
import { useStrictMemo } from "stack-shared/src/hooks/use-strict-memo";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/src/hooks/use-strict-memo";
|
||||
import { useAdminApp } from "./useAdminInterface";
|
||||
import { Box, Stack, Typography } from "@mui/joy";
|
||||
import { Paragraph } from "@/components/paragraph";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
"use client";;
|
||||
import * as React from 'react';
|
||||
import { ApiKeySetSummary } from 'stack-shared';
|
||||
import { ApiKeySetSummary } from '@stackframe/stack-shared';
|
||||
import { Checkbox, Stack, Tooltip, Typography } from '@mui/joy';
|
||||
import { Dialog } from '@/components/dialog';
|
||||
import { useAdminApp } from '../../useAdminInterface';
|
||||
|
||||
@ -2,15 +2,15 @@
|
||||
|
||||
import { use, useId, useState } from "react";
|
||||
import { Box, Button, Checkbox, DialogActions, DialogContent, DialogTitle, Divider, FormControl, FormLabel, Input, Modal, ModalDialog, Select, Option, Stack, FormHelperText, Typography } from "@mui/joy";
|
||||
import { ApiKeySetFirstView } from "stack-shared";
|
||||
import { ApiKeySetFirstView } from "@stackframe/stack-shared";
|
||||
import { AsyncButton } from "@/components/async-button";
|
||||
import { Icon } from "@/components/icon";
|
||||
import { Paragraph } from "@/components/paragraph";
|
||||
import { CopyButton } from "@/components/copy-button";
|
||||
import { useStrictMemo } from "stack-shared/src/hooks/use-strict-memo";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/src/hooks/use-strict-memo";
|
||||
import { ApiKeysTable } from "./api-keys-table";
|
||||
import { useAdminApp } from "../../useAdminInterface";
|
||||
import { runAsynchronously } from "stack-shared/src/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/src/utils/promises";
|
||||
import EnvKeys from "@/components/env-keys";
|
||||
import Link from "next/link";
|
||||
|
||||
|
||||
@ -4,14 +4,14 @@ import { Typography } from "@mui/joy";
|
||||
import React, { use, useState } from "react";
|
||||
import { InlineCode } from "@/components/inline-code";
|
||||
import { Paragraph } from "@/components/paragraph";
|
||||
import { useStrictMemo } from "stack-shared/src/hooks/use-strict-memo";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/src/hooks/use-strict-memo";
|
||||
import { IconAlert } from "@/components/icon-alert";
|
||||
import { Enumeration, EnumerationItem } from "@/components/enumeration";
|
||||
import { SmartLink } from "@/components/smart-link";
|
||||
import { SmartSwitch } from "@/components/smart-switch";
|
||||
import { SimpleCard } from "@/components/simple-card";
|
||||
import { useAdminApp } from "../../useAdminInterface";
|
||||
import { getProductionModeErrors } from "stack-shared";
|
||||
import { getProductionModeErrors } from "@stackframe/stack-shared";
|
||||
|
||||
export default function EnvironmentClient() {
|
||||
const stackAdminApp = useAdminApp();
|
||||
|
||||
@ -12,7 +12,7 @@ import ListItemContent from '@mui/joy/ListItemContent';
|
||||
import Typography from '@mui/joy/Typography';
|
||||
import { useAdminApp } from './useAdminInterface';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { useUser } from 'stack';
|
||||
import { useUser } from '@stackframe/stack';
|
||||
import { Dropdown, MenuButton, MenuItem, Menu, useColorScheme, Stack, Sheet } from '@mui/joy';
|
||||
import { Icon } from '@/components/icon';
|
||||
import { AsyncButton } from '@/components/async-button';
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { StackAdminInterface } from "stack-shared";
|
||||
import { StackAdminInterface } from "@stackframe/stack-shared";
|
||||
import React from "react";
|
||||
import { useStrictMemo } from "stack-shared/src/hooks/use-strict-memo";
|
||||
import { useUser } from "stack";
|
||||
import { throwErr } from "stack-shared/dist/utils/errors";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/src/hooks/use-strict-memo";
|
||||
import { useUser } from "@stackframe/stack";
|
||||
import { throwErr } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
|
||||
const StackAdminInterfaceContext = React.createContext<StackAdminInterface | null>(null);
|
||||
|
||||
|
||||
@ -2,15 +2,15 @@
|
||||
|
||||
import { Button, Card, CardContent, CardOverflow, Divider, FormControl, FormLabel, Grid, Input, Stack, Textarea, Typography } from "@mui/joy";
|
||||
import { use, useId, useRef, useState } from "react";
|
||||
import { useStackApp } from "stack";
|
||||
import { prettyPrintWithMagnitudes } from "stack-shared/dist/utils/numbers";
|
||||
import { useStackApp } from "@stackframe/stack";
|
||||
import { prettyPrintWithMagnitudes } from "@stackframe/stack-shared/dist/utils/numbers";
|
||||
import { Dialog } from "@/components/dialog";
|
||||
import { Paragraph } from "@/components/paragraph";
|
||||
import { SmartLink } from "@/components/smart-link";
|
||||
import { useFromNow } from "@/hooks/use-from-now";
|
||||
import { useStrictMemo } from "stack-shared/src/hooks/use-strict-memo";
|
||||
import { runAsynchronously } from "stack-shared/src/utils/promises";
|
||||
import { Project } from "stack/dist/lib/stack-app";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/src/hooks/use-strict-memo";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/src/utils/promises";
|
||||
import { Project } from "@stackframe/stack/dist/lib/stack-app";
|
||||
|
||||
|
||||
export default function ProjectsPageClient() {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { StackHandler } from "stack";
|
||||
import { StackHandler } from "@stackframe/stack";
|
||||
import { stackServerApp } from "@/stack";
|
||||
|
||||
export default function Handler(props: any) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { StackProvider } from "stack";
|
||||
import { StackProvider } from "@stackframe/stack";
|
||||
import { stackServerApp } from "@/stack";
|
||||
|
||||
export default function Layout(props: { children: React.ReactNode }) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { checkApiKeySet, getApiKeySet, revokeApiKeySet, superSecretAdminKeyHeaderSchema } from "@/lib/api-keys";
|
||||
import { isProjectAdmin } from "@/lib/projects";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { checkApiKeySet, createApiKeySet, listApiKeySets, superSecretAdminKeyHeaderSchema } from "@/lib/api-keys";
|
||||
import { isProjectAdmin } from "@/lib/projects";
|
||||
|
||||
@ -2,13 +2,13 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { generators } from "openid-client";
|
||||
import { cookies } from "next/headers";
|
||||
import { encryptJWT } from "stack-shared/dist/utils/jwt";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { encryptJWT } from "@stackframe/stack-shared/dist/utils/jwt";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { smartRouteHandler, parseRequest } from "@/lib/route-handlers";
|
||||
import { getAuthorizationUrl } from "@/oauth";
|
||||
import { getProject } from "@/lib/projects";
|
||||
import { checkApiKeySet } from "@/lib/api-keys";
|
||||
import { ProjectIdOrKeyInvalidErrorCode, KnownError } from "stack-shared/dist/utils/types";
|
||||
import { ProjectIdOrKeyInvalidErrorCode, KnownError } from "@stackframe/stack-shared/dist/utils/types";
|
||||
|
||||
const getSchema = yup.object({
|
||||
query: yup.object({
|
||||
|
||||
@ -2,14 +2,14 @@ import * as yup from "yup";
|
||||
import { cookies } from "next/headers";
|
||||
import { Request as OauthRequest, Response as OauthResponse } from "@node-oauth/oauth2-server";
|
||||
import { NextRequest } from "next/server";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { decryptJWT } from "stack-shared/dist/utils/jwt";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { decryptJWT } from "@stackframe/stack-shared/dist/utils/jwt";
|
||||
import { smartRouteHandler, parseRequest as parseRequest } from "@/lib/route-handlers";
|
||||
import { getAuthorizationCallback, oauthServer } from "@/oauth";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
import { checkApiKeySet } from "@/lib/api-keys";
|
||||
import { getProject } from "@/lib/projects";
|
||||
import { ProjectIdOrKeyInvalidErrorCode, KnownError } from "stack-shared/dist/utils/types";
|
||||
import { ProjectIdOrKeyInvalidErrorCode, KnownError } from "@stackframe/stack-shared/dist/utils/types";
|
||||
|
||||
const getSchema = yup.object({
|
||||
query: yup.object({
|
||||
|
||||
@ -5,7 +5,7 @@ import {
|
||||
EmailVerificationLinkInvalidErrorCode,
|
||||
EmailVerificationLinkUsedErrorCode,
|
||||
EmailVerificationLinkExpiredErrorCode
|
||||
} from "stack-shared/dist/utils/types";
|
||||
} from "@stackframe/stack-shared/dist/utils/types";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import {
|
||||
ProjectIdOrKeyInvalidErrorCode,
|
||||
RedirectUrlInvalidErrorCode,
|
||||
UserNotExistErrorCode
|
||||
} from "stack-shared/dist/utils/types";
|
||||
} from "@stackframe/stack-shared/dist/utils/types";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { sendPasswordResetEmail } from "@/email";
|
||||
|
||||
@ -5,10 +5,10 @@ import {
|
||||
PasswordResetLinkInvalidErrorCode,
|
||||
PasswordResetLinkUsedErrorCode,
|
||||
PasswordResetLinkExpiredErrorCode
|
||||
} from "stack-shared/dist/utils/types";
|
||||
} from "@stackframe/stack-shared/dist/utils/types";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { hashPassword } from "stack-shared/dist/utils/password";
|
||||
import { hashPassword } from "@stackframe/stack-shared/dist/utils/password";
|
||||
|
||||
const postSchema = yup.object({
|
||||
body: yup.object({
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { ProjectIdOrKeyInvalidErrorCode, KnownError, UserNotExistErrorCode, EmailPasswordMissMatchErrorCode } from "stack-shared/dist/utils/types";
|
||||
import { generateSecureRandomString } from "stack-shared/dist/utils/crypto";
|
||||
import { comparePassword } from "stack-shared/dist/utils/password";
|
||||
import { ProjectIdOrKeyInvalidErrorCode, KnownError, UserNotExistErrorCode, EmailPasswordMissMatchErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
||||
import { generateSecureRandomString } from "@stackframe/stack-shared/dist/utils/crypto";
|
||||
import { comparePassword } from "@stackframe/stack-shared/dist/utils/password";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { encodeAccessToken } from "@/lib/access-token";
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { PasswordFormatInvalidErrorCode, ProjectIdOrKeyInvalidErrorCode, RedirectUrlInvalidErrorCode, KnownError, UserAlreadyExistErrorCode } from "stack-shared/dist/utils/types";
|
||||
import { generateSecureRandomString } from "stack-shared/dist/utils/crypto";
|
||||
import { generateUuid } from "stack-shared/dist/utils/uuids";
|
||||
import { hashPassword } from "stack-shared/dist/utils/password";
|
||||
import { PasswordFormatInvalidErrorCode, ProjectIdOrKeyInvalidErrorCode, RedirectUrlInvalidErrorCode, KnownError, UserAlreadyExistErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
||||
import { generateSecureRandomString } from "@stackframe/stack-shared/dist/utils/crypto";
|
||||
import { generateUuid } from "@stackframe/stack-shared/dist/utils/uuids";
|
||||
import { hashPassword } from "@stackframe/stack-shared/dist/utils/password";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { encodeAccessToken } from "@/lib/access-token";
|
||||
import { sendVerificationEmail } from "@/email";
|
||||
import { getProject } from "@/lib/projects";
|
||||
import { validateUrl } from "@/utils/url";
|
||||
import { getPasswordError } from "stack-shared/src/helpers/password";
|
||||
import { getPasswordError } from "@stackframe/stack-shared/src/helpers/password";
|
||||
import { getApiKeySet, publishableClientKeyHeaderSchema } from "@/lib/api-keys";
|
||||
|
||||
const postSchema = yup.object({
|
||||
|
||||
@ -3,7 +3,7 @@ import { InvalidGrantError, Request as OauthRequest, Response as OauthResponse,
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { oauthServer } from "@/oauth";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { GrantInvalidErrorCode, ProjectIdOrKeyInvalidErrorCode, KnownError } from "stack-shared/dist/utils/types";
|
||||
import { GrantInvalidErrorCode, ProjectIdOrKeyInvalidErrorCode, KnownError } from "@stackframe/stack-shared/dist/utils/types";
|
||||
|
||||
// make this specific to each grant type later
|
||||
const postSchema = yup.object({
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { checkApiKeySet, publishableClientKeyHeaderSchema, secretServerKeyHeaderSchema } from "@/lib/api-keys";
|
||||
import { isProjectAdmin } from "@/lib/projects";
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { checkApiKeySet, publishableClientKeyHeaderSchema, superSecretAdminKeyHeaderSchema } from "@/lib/api-keys";
|
||||
import { isProjectAdmin, updateProject } from "@/lib/projects";
|
||||
import { ClientProjectJson } from "stack-shared/dist/interface/clientInterface";
|
||||
import { ProjectIdOrKeyInvalidErrorCode, KnownError } from "stack-shared/dist/utils/types";
|
||||
import { ClientProjectJson } from "@stackframe/stack-shared/dist/interface/clientInterface";
|
||||
import { ProjectIdOrKeyInvalidErrorCode, KnownError } from "@stackframe/stack-shared/dist/utils/types";
|
||||
|
||||
const putOrGetSchema = yup.object({
|
||||
headers: yup.object({
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { smartRouteHandler, parseRequest } from "@/lib/route-handlers";
|
||||
import { createProject, listProjects } from "@/lib/projects";
|
||||
import { authorizationHeaderSchema, decodeAccessToken } from "@/lib/access-token";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { checkApiKeySet, secretServerKeyHeaderSchema } from "@/lib/api-keys";
|
||||
import { isProjectAdmin } from "@/lib/projects";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import * as yup from "yup";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { parseRequest, smartRouteHandler } from "@/lib/route-handlers";
|
||||
import { checkApiKeySet, secretServerKeyHeaderSchema } from "@/lib/api-keys";
|
||||
import { isProjectAdmin } from "@/lib/projects";
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { Button, ButtonProps } from "@mui/joy";
|
||||
import React from "react";
|
||||
import { runAsynchronously } from "stack-shared/src/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/src/utils/promises";
|
||||
|
||||
export function AsyncButton(props: Omit<ButtonProps, 'onClick'> & {
|
||||
onClick?: (...args: Parameters<ButtonProps['onClick'] & {}>) => Promise<void> | void | any,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { CircularProgress, IconButton, IconButtonProps } from "@mui/joy";
|
||||
import React from "react";
|
||||
import { runAsynchronously } from "stack-shared/src/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/src/utils/promises";
|
||||
|
||||
export function AsyncIconButton(props: Omit<IconButtonProps, 'onClick'> & {
|
||||
onClick?: (...args: Parameters<IconButtonProps['onClick'] & {}>) => Promise<void> | void | any,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Box } from "@mui/joy";
|
||||
import { Code } from "bright";
|
||||
import { typedIncludes } from "stack-shared/dist/utils/arrays";
|
||||
import { typedIncludes } from "@stackframe/stack-shared/dist/utils/arrays";
|
||||
import { CopyButton } from "./copy-button";
|
||||
|
||||
type CodeBlockProps = Omit<React.ComponentProps<typeof Box>, "children"> & {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import React, { use } from "react";
|
||||
import { Box, Checkbox, Stack, Typography } from "@mui/joy";
|
||||
import { typedIncludes } from "stack-shared/dist/utils/arrays";
|
||||
import { typedIncludes } from "@stackframe/stack-shared/dist/utils/arrays";
|
||||
|
||||
const enumerationContext = React.createContext<{ type: EnumerationProps["type"] } | null>(null);
|
||||
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
import { Typography, TypographyProps } from "@mui/joy";
|
||||
import { MouseEvent } from "react";
|
||||
import { hasClickableParent } from "stack-shared/dist/utils/dom";
|
||||
import { hasClickableParent } from "@stackframe/stack-shared/dist/utils/dom";
|
||||
import { getNodeText } from "@/utils/react";
|
||||
import { useSnackbar } from "@/hooks/use-snackbar";
|
||||
import { runAsynchronously } from "stack-shared/src/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/src/utils/promises";
|
||||
|
||||
export function InlineCode(props: TypographyProps<"code">) {
|
||||
const { onClick, style, ...typographyProps } = props;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Box } from "@mui/joy";
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import { throwErr } from "stack-shared/dist/utils/errors";
|
||||
import { deepPlainEquals } from "stack-shared/dist/utils/objects";
|
||||
import { throwErr } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { deepPlainEquals } from "@stackframe/stack-shared/dist/utils/objects";
|
||||
import { useMutationObserver } from "@/hooks/use-mutation-observer";
|
||||
|
||||
type Level = 1 | 2 | 3 | 4 | 5 | 6;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { Box, CircularProgress, Stack, Switch, SwitchProps } from "@mui/joy";
|
||||
import React from "react";
|
||||
import { runAsynchronously } from "stack-shared/src/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/src/utils/promises";
|
||||
|
||||
type T = Parameters<SwitchProps['onChange'] & {}>;
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import nodemailer from 'nodemailer';
|
||||
import VerificationEmail from './templates/verification';
|
||||
import { prismaClient } from '@/prisma-client';
|
||||
import { getEnvVariable } from 'stack-shared/dist/utils/env';
|
||||
import { generateSecureRandomString } from 'stack-shared/dist/utils/crypto';
|
||||
import { getEnvVariable } from '@stackframe/stack-shared/dist/utils/env';
|
||||
import { generateSecureRandomString } from '@stackframe/stack-shared/dist/utils/crypto';
|
||||
import { getProject } from '@/lib/projects';
|
||||
import { render } from '@react-email/render';
|
||||
import { UserJson, ProjectJson } from 'stack-shared';
|
||||
import { UserJson, ProjectJson } from '@stackframe/stack-shared';
|
||||
import { getClientUser } from '@/lib/users';
|
||||
import PasswordResetEmail from './templates/password-reset';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { fromNowDetailed } from "stack-shared/dist/utils/dates";
|
||||
import { fromNowDetailed } from "@stackframe/stack-shared/dist/utils/dates";
|
||||
|
||||
export function useFromNow(date: Date): string {
|
||||
const [invalidationCounter, setInvalidationCounter] = useState(0);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { Snackbar, SnackbarProps } from "@mui/joy";
|
||||
import { createContext, use, useCallback, useMemo, useState } from "react";
|
||||
import { Icon } from "@/components/icon";
|
||||
import { generateUuid } from "stack-shared/dist/utils/uuids";
|
||||
import { generateUuid } from "@stackframe/stack-shared/dist/utils/uuids";
|
||||
|
||||
export type SnackbarOptions = Omit<SnackbarProps, "open">;
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import * as yup from 'yup';
|
||||
import { JWTExpired } from 'jose/errors';
|
||||
import { AccessTokenExpiredErrorCode, KnownError } from 'stack-shared/dist/utils/types';
|
||||
import { decryptJWT, encryptJWT } from 'stack-shared/dist/utils/jwt';
|
||||
import { StatusError } from 'stack-shared/dist/utils/errors';
|
||||
import { AccessTokenExpiredErrorCode, KnownError } from '@stackframe/stack-shared/dist/utils/types';
|
||||
import { decryptJWT, encryptJWT } from '@stackframe/stack-shared/dist/utils/jwt';
|
||||
import { StatusError } from '@stackframe/stack-shared/dist/utils/errors';
|
||||
|
||||
export const authorizationHeaderSchema = yup.string().matches(/^StackSession [^ ]+$/);
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import * as yup from 'yup';
|
||||
import { ApiKeySetFirstViewJson, ApiKeySetSummaryJson } from 'stack-shared';
|
||||
import { ApiKeySetFirstViewJson, ApiKeySetSummaryJson } from '@stackframe/stack-shared';
|
||||
import { ApiKeySet } from '@prisma/client';
|
||||
import { generateSecureRandomString } from 'stack-shared/dist/utils/crypto';
|
||||
import { generateSecureRandomString } from '@stackframe/stack-shared/dist/utils/crypto';
|
||||
import * as crypto from 'node:crypto';
|
||||
import { prismaClient } from '@/prisma-client';
|
||||
import { generateUuid } from 'stack-shared/dist/utils/uuids';
|
||||
import { generateUuid } from '@stackframe/stack-shared/dist/utils/uuids';
|
||||
|
||||
export const publishableClientKeyHeaderSchema = yup.string().matches(/^[a-zA-Z0-9_-]*$/);
|
||||
export const secretServerKeyHeaderSchema = publishableClientKeyHeaderSchema;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { OauthProviderConfigJson, ProjectJson, ServerUserJson } from "stack-shared";
|
||||
import { OauthProviderConfigJson, ProjectJson, ServerUserJson } from "@stackframe/stack-shared";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
import { decodeAccessToken } from "./access-token";
|
||||
import { getServerUser } from "./users";
|
||||
import { generateUuid } from "stack-shared/dist/utils/uuids";
|
||||
import { EmailConfigJson } from "stack-shared/dist/interface/clientInterface";
|
||||
import { generateUuid } from "@stackframe/stack-shared/dist/utils/uuids";
|
||||
import { EmailConfigJson } from "@stackframe/stack-shared/dist/interface/clientInterface";
|
||||
|
||||
const fullProjectInclude = {
|
||||
config: {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { NextRequest } from "next/server";
|
||||
import { StatusError } from "stack-shared/dist/utils/errors";
|
||||
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import * as yup from "yup";
|
||||
|
||||
export async function parseRequest<T>(req: NextRequest, schema: yup.Schema<T>): Promise<T> {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { UserCustomizableJson, UserJson, ServerUserCustomizableJson, ServerUserJson } from "stack-shared";
|
||||
import { UserCustomizableJson, UserJson, ServerUserCustomizableJson, ServerUserJson } from "@stackframe/stack-shared";
|
||||
import { ProjectUser } from "@prisma/client";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import type { NextRequest } from 'next/server';
|
||||
import { wait } from 'stack-shared/dist/utils/promises';
|
||||
import { wait } from '@stackframe/stack-shared/dist/utils/promises';
|
||||
|
||||
const allowedCorsHeaders = [
|
||||
'authorization',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import OAuth2Server from "@node-oauth/oauth2-server";
|
||||
import { OauthProviderConfigJson } from "stack-shared";
|
||||
import { getEnvVariable } from "stack-shared/dist/utils/env";
|
||||
import { OauthProviderConfigJson } from "@stackframe/stack-shared";
|
||||
import { getEnvVariable } from "@stackframe/stack-shared/dist/utils/env";
|
||||
import { GithubProvider } from "./github";
|
||||
import { OauthModel } from "./model";
|
||||
import { OauthUserInfo } from "./utils";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { AuthorizationCode, AuthorizationCodeModel, Client, Falsey, OAuth2Server, RefreshToken, Token, User } from "@node-oauth/oauth2-server";
|
||||
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";
|
||||
import { generateSecureRandomString } from "stack-shared/dist/utils/crypto";
|
||||
import { generateSecureRandomString } from "@stackframe/stack-shared/dist/utils/crypto";
|
||||
import { prismaClient } from "@/prisma-client";
|
||||
import { decodeAccessToken, encodeAccessToken } from "@/lib/access-token";
|
||||
import { validateUrl } from "@/utils/url";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { StackServerApp } from 'stack';
|
||||
import { throwErr } from 'stack-shared/dist/utils/errors';
|
||||
import { StackServerApp } from '@stackframe/stack';
|
||||
import { throwErr } from '@stackframe/stack-shared/dist/utils/errors';
|
||||
|
||||
export const stackServerApp = new StackServerApp({
|
||||
baseUrl: process.env.NEXT_PUBLIC_STACK_URL || throwErr('missing NEXT_PUBLIC_STACK_URL environment variable'),
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { use } from "react";
|
||||
import { neverResolve } from "stack-shared/dist/utils/promises";
|
||||
import { neverResolve } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
|
||||
export function getNodeText(node: React.ReactNode): string {
|
||||
if (["number", "string"].includes(typeof node)) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { DomainConfigJson } from "stack-shared/dist/interface/clientInterface";
|
||||
import { DomainConfigJson } from "@stackframe/stack-shared/dist/interface/clientInterface";
|
||||
|
||||
export function validateUrl(url: string, domains: DomainConfigJson[], allowLocalhost: boolean): boolean {
|
||||
if (allowLocalhost && new URL(url).hostname === "localhost") {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "stack-shared",
|
||||
"name": "@stackframe/stack-shared",
|
||||
"version": "1.0.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "stack",
|
||||
"name": "@stackframe/stack",
|
||||
"version": "1.0.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@ -21,7 +21,7 @@
|
||||
"js-cookie": "^3.0.5",
|
||||
"oauth4webapi": "^2.10.3",
|
||||
"react-icons": "^5.0.1",
|
||||
"stack-shared": "workspace:*",
|
||||
"@stackframe/stack-shared": "workspace:*",
|
||||
"tailwindcss-scoped-preflight": "^2.1.0",
|
||||
"server-only": "^0.0.1"
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@ import { use } from "react";
|
||||
import { useStackApp } from "..";
|
||||
import MessageCard from "../elements/MessageCard";
|
||||
import RedirectMessageCard from "../elements/RedirectMessageCard";
|
||||
import { EmailVerificationLinkExpiredErrorCode, EmailVerificationLinkInvalidErrorCode, EmailVerificationLinkUsedErrorCode } from "stack-shared/dist/utils/types";
|
||||
import { EmailVerificationLinkExpiredErrorCode, EmailVerificationLinkInvalidErrorCode, EmailVerificationLinkUsedErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
||||
|
||||
export default function EmailVerification({
|
||||
searchParams: {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
import { useRef, useEffect } from "react";
|
||||
import { useStackApp } from "..";
|
||||
import { runAsynchronously } from "stack-shared/dist/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
import MessageCard from "../elements/MessageCard";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
|
||||
@ -4,8 +4,8 @@ import MessageCard from "../elements/MessageCard";
|
||||
import { useStackApp } from "..";
|
||||
import { use } from "react";
|
||||
import PasswordResetInner from "../elements/PasswordResetInner";
|
||||
import { PasswordResetLinkExpiredErrorCode, PasswordResetLinkInvalidErrorCode, PasswordResetLinkUsedErrorCode } from "stack-shared/dist/utils/types";
|
||||
import { useStrictMemo } from "stack-shared/dist/hooks/use-strict-memo";
|
||||
import { PasswordResetLinkExpiredErrorCode, PasswordResetLinkInvalidErrorCode, PasswordResetLinkUsedErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/dist/hooks/use-strict-memo";
|
||||
|
||||
export default function PasswordReset({
|
||||
searchParams,
|
||||
|
||||
@ -5,8 +5,8 @@ import { validateEmail } from "../utils/email";
|
||||
import NextLink from "next/link";
|
||||
import { useStackApp } from "..";
|
||||
import Button from "./Button";
|
||||
import { runAsynchronously } from "stack-shared/dist/utils/promises";
|
||||
import { EmailPasswordMissMatchErrorCode, UserNotExistErrorCode } from "stack-shared/dist/utils/types";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
import { EmailPasswordMissMatchErrorCode, UserNotExistErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
||||
// Import or define the PasswordField, FormWarningText, and validateEmail utilities if they're custom components or functions.
|
||||
|
||||
export default function CredentialSignIn({ redirectUrl }: { redirectUrl?: string }) {
|
||||
|
||||
@ -4,11 +4,11 @@ import { useState } from "react";
|
||||
import { PasswordField } from "./PasswordField";
|
||||
import { FormWarningText } from "./FormWarning";
|
||||
import { validateEmail } from "../utils/email";
|
||||
import { getPasswordError } from "stack-shared/src/helpers/password";
|
||||
import { getPasswordError } from "@stackframe/stack-shared/src/helpers/password";
|
||||
import { useStackApp } from "..";
|
||||
import { runAsynchronously } from "stack-shared/dist/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
import Button from "./Button";
|
||||
import { UserAlreadyExistErrorCode } from "stack-shared/dist/utils/types";
|
||||
import { UserAlreadyExistErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
||||
|
||||
export default function CredentialSignUp({ redirectUrl }: { redirectUrl?: string }) {
|
||||
const [email, setEmail] = useState('');
|
||||
|
||||
@ -4,7 +4,7 @@ import { useState } from "react";
|
||||
import { FormWarningText } from "./FormWarning";
|
||||
import { validateEmail } from "../utils/email";
|
||||
import { useStackApp } from "..";
|
||||
import { runAsynchronously } from "stack-shared/dist/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
import Button from "./Button";
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { FaGoogle, FaGithub, FaFacebook, FaApple, FaMicrosoft } from 'react-icons/fa';
|
||||
import { useStackApp } from '..';
|
||||
import { runAsynchronously } from "stack-shared/dist/utils/promises";
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
import Button from './Button';
|
||||
|
||||
const iconSize = 24;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from "react";
|
||||
import { getPasswordError } from "stack-shared/src/helpers/password";
|
||||
import { getPasswordError } from "@stackframe/stack-shared/src/helpers/password";
|
||||
import { useStackApp } from "..";
|
||||
import { PasswordField } from "./PasswordField";
|
||||
import { FormWarningText } from "./FormWarning";
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { StackClientInterface } from "stack-shared";
|
||||
import { StackClientInterface } from "@stackframe/stack-shared";
|
||||
import { saveVerifierAndState, getVerifierAndState } from "./cookie";
|
||||
import { constructRedirectUrl } from "../utils/url";
|
||||
import { TokenStore } from "stack-shared/dist/interface/clientInterface";
|
||||
import { SignInErrorCode, SignUpErrorCode } from "stack-shared/dist/utils/types";
|
||||
import { TokenStore } from "@stackframe/stack-shared/dist/interface/clientInterface";
|
||||
import { SignInErrorCode, SignUpErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
||||
|
||||
export async function signInWithOauth(
|
||||
iface: StackClientInterface,
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
import React, { use, useCallback } from "react";
|
||||
import { OauthProviderConfigJson, ServerUserCustomizableJson, ServerUserJson, StackAdminInterface, StackClientInterface, StackServerInterface } from "stack-shared";
|
||||
import { OauthProviderConfigJson, ServerUserCustomizableJson, ServerUserJson, StackAdminInterface, StackClientInterface, StackServerInterface } from "@stackframe/stack-shared";
|
||||
import { getCookie, setOrDeleteCookie } from "./cookie";
|
||||
import { throwErr } from "stack-shared/dist/utils/errors";
|
||||
import { AsyncValueCache } from "stack-shared/dist/utils/caches";
|
||||
import { generateUuid } from "stack-shared/dist/utils/uuids";
|
||||
import { AsyncResult } from "stack-shared/dist/utils/results";
|
||||
import { suspendIfSsr } from "stack-shared/dist/utils/react";
|
||||
import { AsyncStore } from "stack-shared/dist/utils/stores";
|
||||
import { ClientProjectJson, UserCustomizableJson, UserJson, TokenObject, TokenStore, ProjectJson, EmailConfigJson, DomainConfigJson } from "stack-shared/dist/interface/clientInterface";
|
||||
import { throwErr } from "@stackframe/stack-shared/dist/utils/errors";
|
||||
import { AsyncValueCache } from "@stackframe/stack-shared/dist/utils/caches";
|
||||
import { generateUuid } from "@stackframe/stack-shared/dist/utils/uuids";
|
||||
import { AsyncResult } from "@stackframe/stack-shared/dist/utils/results";
|
||||
import { suspendIfSsr } from "@stackframe/stack-shared/dist/utils/react";
|
||||
import { AsyncStore } from "@stackframe/stack-shared/dist/utils/stores";
|
||||
import { ClientProjectJson, UserCustomizableJson, UserJson, TokenObject, TokenStore, ProjectJson, EmailConfigJson, DomainConfigJson } from "@stackframe/stack-shared/dist/interface/clientInterface";
|
||||
import { isClient } from "../utils/next";
|
||||
import { callOauthCallback, signInWithCredential, signInWithOauth, signUpWithCredential } from "./auth";
|
||||
import { RedirectType, redirect, useRouter } from "next/navigation";
|
||||
import { ReadonlyJson } from "../utils/types";
|
||||
import { constructRedirectUrl } from "../utils/url";
|
||||
import { EmailVerificationLinkErrorCode, PasswordResetLinkErrorCode, SignInErrorCode, SignUpErrorCode } from "stack-shared/dist/utils/types";
|
||||
import { filterUndefined } from "stack-shared/dist/utils/objects";
|
||||
import { neverResolve, resolved, runAsynchronously, wait } from "stack-shared/dist/utils/promises";
|
||||
import { EmailVerificationLinkErrorCode, PasswordResetLinkErrorCode, SignInErrorCode, SignUpErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
||||
import { filterUndefined } from "@stackframe/stack-shared/dist/utils/objects";
|
||||
import { neverResolve, resolved, runAsynchronously, wait } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
|
||||
|
||||
export type TokenStoreOptions<HasTokenStore extends boolean = boolean> =
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { cache, use } from "react";
|
||||
import { StackClientApp, StackClientAppJson, stackAppInternalsSymbol } from "../lib/stack-app";
|
||||
import React from "react";
|
||||
import { useStrictMemo } from "stack-shared/dist/hooks/use-strict-memo";
|
||||
import { useStrictMemo } from "@stackframe/stack-shared/dist/hooks/use-strict-memo";
|
||||
|
||||
export const StackContext = React.createContext<null | {
|
||||
app: StackClientApp<true>,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { use } from "react";
|
||||
import { neverResolve } from "stack-shared/dist/utils/promises";
|
||||
import { neverResolve } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
|
||||
export function suspend(): never {
|
||||
use(neverResolve());
|
||||
|
||||
784
pnpm-lock.yaml
784
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user