Commit Graph

1741 Commits

Author SHA1 Message Date
Konstantin Wohlwend
217e6da8b6 Verbose test outputs 2025-03-19 14:07:21 -07:00
Konstantin Wohlwend
656bf4c44b chore: update package versions 2025-03-19 12:54:10 -07:00
Moritz Schneider
ab81ad14e1
Implement Model Context Protocol server poc (#552)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Introduces a new Model Context Protocol server with OpenAPI
integration, updates build configurations, and adds necessary files for
initial release.
> 
>   - **New MCP Server**:
> - Implements MCP server in `src/index.ts` using
`@modelcontextprotocol/sdk`.
> - Handles tool requests with `ListToolsRequestSchema` and
`CallToolRequestSchema`.
>     - Supports 40 endpoints, defined in `operationIDs`.
>   - **OpenAPI Integration**:
> - Generates OpenAPI schema in `generate-openapi.ts` and writes to
`mcp-server/openapi`.
> - Converts OpenAPI parameters to JSON schema in
`openapi-to-jsonschema.ts`.
>   - **Configuration and Build**:
> - Adds `package.json` for MCP server with dependencies and scripts.
>     - Configures ESLint in `.eslintrc.cjs`.
> - Updates `Dockerfile` and `turbo.json` to include MCP server in build
process.
>   - **Miscellaneous**:
>     - Adds `.gitignore` for OpenAPI JSON files.
>     - Initial release noted in `CHANGELOG.md`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for d0970c4059. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-03-19 18:49:39 +00:00
Konstantin Wohlwend
130c8e648e Fix CI 2025-03-19 09:32:10 -07:00
Konstantin Wohlwend
79668811db Disable file parallelism for dev tests 2025-03-18 13:13:52 -07:00
Konstantin Wohlwend
e7104dcb52 Wait longer in test 2025-03-18 10:25:28 -07:00
Zai Shi
5a3d248ae0
Fix update password (#554)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Adds `updatePassword` method to `StackServerInterface` and updates
`_StackServerAppImplIncomplete` to use it for password updates.
> 
>   - **Behavior**:
> - Adds `updatePassword` method to `StackServerInterface` in
`serverInterface.ts` to update user passwords via POST to
`/auth/password/update`.
> - Handles `PasswordConfirmationMismatch` and
`PasswordRequirementsNotMet` errors.
>   - **Implementation**:
> - Updates `updatePassword` method in `_StackServerAppImplIncomplete`
in `server-app-impl.ts` to use `StackServerInterface.updatePassword`.
>     - Requires `oldPassword` in `updatePassword` options.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 5dd07df3ee. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
2025-03-18 18:05:10 +01:00
Moritz Schneider
970332dc90
don't show password option if not enabled (#555)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Add conditional rendering to `PasswordSection` in
`account-settings.tsx` to hide password option if `credentialEnabled` is
false.
> 
>   - **Behavior**:
> - In `PasswordSection` in `account-settings.tsx`, add a check for
`project.config.credentialEnabled`.
> - If `credentialEnabled` is false, `PasswordSection` returns `null`,
hiding the password option.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 9c65ddb4f9. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
2025-03-18 10:02:01 -07:00
Konstantin Wohlwend
4a4e6bb387 GET should work with content-type set
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Preview Docs / run (push) Has been cancelled
Dev Environment Test / test (push) Has been cancelled
Run setup tests / test (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2025-03-16 16:54:16 -07:00
Moritz Schneider
7a7aabf6f9
Fix team permission API documentation (#549)
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Preview Docs / run (push) Has been cancelled
Dev Environment Test / test (push) Has been cancelled
Run setup tests / test (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Add `onlyShowInOperations: ['List']` to query parameters in `crud.tsx`
to limit OpenAPI visibility to 'List' operations.
> 
>   - **Metadata Changes**:
> - Added `onlyShowInOperations: ['List']` to `team_id`, `user_id`,
`permission_id`, and `recursive` in `querySchema` in `crud.tsx`.
> - Limits visibility of these parameters to 'List' operations in
OpenAPI documentation.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for ba1f2cadd0. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
2025-03-15 01:53:16 +00:00
CactusBlue
cbbd8ab066
Hide Last Used (#547)
<!-- ELLIPSIS_HIDDEN -->


> [!IMPORTANT]
> `OAuthButton` now conditionally hides the 'last used' label based on
the `isMock` prop, affecting mock environments.
> 
>   - **Behavior**:
> - `OAuthButton` in `oauth-button.tsx` now accepts `isMock` prop to
conditionally hide 'last used' label.
> - In `oauth-button-group.tsx`, `OAuthButton` is passed `isMock` based
on `mockProject` presence.
>   - **Props**:
> - Added `isMock` prop to `OAuthButton` to control display of 'last
used' label.
>   - **Rendering**:
>     - `lastUsed` label in `OAuthButton` is hidden if `isMock` is true.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 310760fa7c. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-03-15 02:36:04 +01:00
Antoine Delplace
217b0161a9
Fix sign in button in forgot password page (#538)
Fix sign in button in forgot password page

<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Fixes 'Sign in' button link in `forgot-password.tsx` to point to the
correct URL.
> 
>   - **Behavior**:
> - Fixes the 'Sign in' button link in `forgot-password.tsx` to point to
`signIn` URL instead of `signUp`.
>   - **Misc**:
>     - No other changes or additions.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for e6590a1a88. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-03-15 02:35:49 +01:00
Moritz Schneider
70c3352fb5
fix docs for team invitation accept endpoint (#548)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Update documentation in `teamInvitationCodeHandler` to accurately
describe the team invitation acceptance process.
> 
>   - **Documentation**:
> - Update `summary` in `teamInvitationCodeHandler` to "Accept the team
invitation".
> - Update `description` in `teamInvitationCodeHandler` to "Accept
invitation and add user to the team".
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for f702886309. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
2025-03-15 01:25:28 +00:00
Moritz Schneider
09f648e76c
add getUser overload (#544)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Add `getUser` overload to fetch `ServerUser` by ID in `server-app.ts`
and `server-app-impl.ts`.
> 
>   - **Functionality**:
> - Adds `getUser(id: string): Promise<ServerUser | null>` overload to
`getUser` in `server-app.ts` and `server-app-impl.ts`.
> - Allows fetching a `ServerUser` by ID, returning `null` if not found.
>   - **Implementation**:
> - Updates `getUser` method in `server-app-impl.ts` to handle string ID
input and call `getServerUserById`.
>   - **Interface**:
> - Updates `StackServerApp` type in `server-app.ts` to include new
`getUser` overload.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 071bd2a2e6. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
2025-03-14 19:27:15 +01:00
Moritz Schneider
28fd26e5cb
Add way to create contact channles for admin (#543)
<img width="1752" alt="Screenshot 2025-03-13 at 13 56 17"
src="https://github.com/user-attachments/assets/7b8b3be0-6a3a-4506-b9ac-dbc4683f129d"
/>


<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Add UI and server-side support for managing user email contact
channels, including new form components and schema updates.
> 
>   - **UI Enhancements**:
> - Added `ContactChannelsSection` and `AddEmailDialog` components in
`page-client.tsx` for managing user emails.
> - Introduced `CheckboxField` in `form-fields.tsx` for form handling.
>   - **Server Logic**:
> - Updated `server-app-impl.ts` to refresh caches after contact channel
updates and deletions.
> - Added `isPrimary` and `isVerified` fields to
`ServerContactChannelCreateOptions` and
`ServerContactChannelUpdateOptions` in `contact-channels/index.ts`.
>   - **Schema and Types**:
> - Updated `SmartFormField` in `smart-form.tsx` to handle boolean
fields using `CheckboxField`.
>     - Added `ServerContactChannel` type to `index.ts`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 51bcc608b8. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->
2025-03-13 23:00:42 +00:00
Konstantin Wohlwend
dee41c41fb Remove radial bg gradient 2025-03-13 13:38:37 -07:00
Konstantin Wohlwend
8ccc26e7cd Allow Vercel headers in CORS 2025-03-13 13:09:51 -07:00
Konstantin Wohlwend
11a6fea271 Support for extra request headers 2025-03-13 12:59:37 -07:00
CactusBlue
62aaa6d45a
Email send dashboard fix (#541)
<!-- ELLIPSIS_HIDDEN -->


> [!IMPORTANT]
> Enhance email configuration handling, add email listing endpoint and
tests, and update schemas for improved security and functionality.
> 
>   - **Email Configuration**:
> - Refactor `prismaModelToCrud` in `crud.tsx` to expand `sender_config`
into detailed fields.
> - Use `emailConfigWithoutPasswordSchema` in `emails.ts` for
`sender_config`.
>   - **API Changes**:
> - Update `internalEmailsCrudHandlers` in `crud.tsx` to use
`auth.tenancy.id` for filtering emails and limit results to 100.
>     - Add `route.tsx` to export `GET` handler for listing emails.
>   - **Testing**:
> - Add `email.test.ts` to test email listing, project isolation, and
admin access restrictions.
> - Add `resetContext` function in `backend-helpers.ts` to reset test
context.
>   - **Miscellaneous**:
> - Implement `emailConfigWithoutPasswordSchema` in `projects.ts` to
exclude password from email config.
>     - Update `snapshot-serializer.ts` to strip `sent_at_millis` field.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 6721f4e13a. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->
2025-03-13 19:49:37 +01:00
Zai Shi
fa599792d6 allow outside PR to run fern preview 2025-03-13 09:56:27 -07:00
Konstantin Wohlwend
717cb7e12c Remove PR trigger for Docker push 2025-03-13 09:46:08 -07:00
Konstantin Wohlwend
f20d250aa7 Remove unnecessary console.error 2025-03-13 09:38:33 -07:00
Konstantin Wohlwend
f796cbf115 Remove unnecessary emails handler
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Mirror main branch to main-mirror-for-wdb / lint_and_build (push) Has been cancelled
Preview Docs / run (push) Has been cancelled
Publish Docs / run (push) Has been cancelled
Dev Environment Test / test (push) Has been cancelled
Run setup tests / test (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2025-03-13 09:29:38 -07:00
Shridhar Deshmukh
496d3bcf88
fix: --no-browser opening browser (#539)
The additional change [in
commander](007ab2b980)
caused an issue with the `--no-browser` option. Commander negates
boolean options with `--no` prefix -
https://www.npmjs.com/package/commander#other-option-types-negatable-boolean-and-booleanvalue


<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Fixes `--no-browser` option in `index.ts` to correctly prevent browser
opening by adjusting boolean logic.
> 
>   - **Behavior**:
> - Fixes `--no-browser` option in `index.ts` to prevent browser opening
by setting `noBrowser` to `!options.browser`.
>   - **Misc**:
> - Adds comment explaining Commander negation behavior for boolean
options.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for a1a3ba450d. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-03-13 17:17:28 +01:00
Konstantin Wohlwend
db4e2b0930 chore: update package versions
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Preview Docs / run (push) Has been cancelled
Dev Environment Test / test (push) Has been cancelled
Run setup tests / test (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
Mirror main branch to main-mirror-for-wdb / lint_and_build (push) Has been cancelled
Publish Docs / run (push) Has been cancelled
2025-03-12 19:03:12 -07:00
devin-ai-integration[bot]
0e3f63d2ac
Add CLI authentication endpoints (#503)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: TheCactusBlue <thecactusblue@gmail.com>
2025-03-12 18:44:33 -07:00
Moritz Schneider
88a81be8c4
remove console log (#534)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Remove `console.log(events)` from `crud.tsx` to clean up code.
> 
>   - **Misc**:
>     - Remove `console.log(events)` from `crud.tsx` to clean up code.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 3c540ee42b. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-03-13 02:44:09 +01:00
Zai Shi
0f7727b6ba
add permission webhooks (#533)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Add webhooks for team permission creation and deletion, updating CRUD
operations and tests to support this functionality.
> 
>   - **Webhooks**:
> - Add `sendTeamPermissionCreatedWebhook` and
`sendTeamPermissionDeletedWebhook` in `webhooks.tsx`.
> - Trigger `sendTeamPermissionCreatedWebhook` on permission creation in
`team-memberships/crud.tsx` and `team-permissions/crud.tsx`.
> - Trigger `sendTeamPermissionDeletedWebhook` on permission deletion in
`team-permissions/crud.tsx`.
>   - **CRUD Operations**:
> - Modify `addUserToTeam` in `team-memberships/crud.tsx` to return
permission IDs.
> - Update `onCreate` and `onDelete` handlers in
`team-permissions/crud.tsx` to handle webhooks.
>   - **Tests**:
> - Add tests in `team-memberships.test.ts` and
`team-permissions.test.ts` to verify webhook triggers for permission
creation and deletion.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 5067753761. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-03-13 02:43:48 +01:00
Zai Shi
ab8b88c747
Add THIS_LINE_PLATFORM macro (#537)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Add `THIS_LINE_PLATFORM` macro for inline platform-specific comments,
replacing `NEXT_LINE_PLATFORM` across the codebase.
> 
>   - **Macro Addition**:
> - Introduces `THIS_LINE_PLATFORM` macro to replace
`NEXT_LINE_PLATFORM` for inline platform-specific comments.
> - Applied in `stack-handler.tsx`, `link.tsx`, `cookie.ts`, and 10
other files.
>   - **Behavior**:
> - `THIS_LINE_PLATFORM` allows inline comments to specify
platform-specific code inclusion.
>     - Ensures platform-specific code clarity and separation.
>   - **Documentation**:
> - Updated documentation files to use `THIS_LINE_PLATFORM` for
platform-specific sections.
>   - **Scripts**:
> - Updated `processMacros` function in `utils.ts` to handle
`THIS_LINE_PLATFORM`.
>     - Adjusted `generate-docs.ts` to process new macro correctly.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for e3a283aa65. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->
2025-03-13 02:35:17 +01:00
Moritz Schneider
5425b3e2dd
add impersonate and error to user details page (#535)
Add some buttons to user details page


<img width="1443" alt="image"
src="https://github.com/user-attachments/assets/1c8fa865-29bc-43e7-ab77-f8ef55f934a4"
/>


<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Add impersonate and delete functionalities to user details page with
new dialogs and error handling.
> 
>   - **User Interface**:
> - Added `Impersonate` and `Delete` buttons to user details page in
`page-client.tsx`.
>     - Introduced `DropdownMenu` for user actions in `page-client.tsx`.
>   - **Dialogs**:
> - Moved `DeleteUserDialog` and `ImpersonateUserDialog` to
`user-dialogs.tsx`.
>     - Updated `DeleteUserDialog` to redirect after deletion.
>   - **Server Interface**:
> - Updated `getServerUserById()` in `serverInterface.ts` to handle
`UserNotFound` error.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 0576c20f76. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-03-13 01:19:47 +00:00
CactusBlue
b322945f9d
SentEmails Dashboard Table (#461)
![image](https://github.com/user-attachments/assets/74322b94-479a-4609-bebb-5a0691da372b)

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Add SentEmails dashboard table with backend API and frontend
components to display email logs.
> 
>   - **Backend**:
> - Add `crud.tsx` to define CRUD operations for `SentEmail` using
`prismaClient`.
> - Add `route.tsx` to expose `GET` endpoint for listing sent emails.
>   - **Frontend**:
> - Update `page-client.tsx` to include `EmailSendDataTable` component
displaying email logs.
>     - Define `emailTableColumns` for `DataTable` in `page-client.tsx`.
>   - **Shared Interfaces**:
> - Add `InternalEmailsCrud` and `sentEmailReadSchema` in `emails.ts`.
>     - Extend `StackAdminApp` to include `listSentEmails()` method.
> - Define `AdminSentEmail` type in `email/index.ts` and export it in
`index.ts`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for fe32ecbc33. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ryan@stack-auth.com <ryan@stack-auth.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-03-13 01:28:47 +01:00
Konstantin Wohlwend
66c5823349 Run auto-update only once per day 2025-03-12 17:10:03 -07:00
Konstantin Wohlwend
08d7403527 Run auto-update every 6 hours 2025-03-12 17:07:15 -07:00
Konstantin Wohlwend
16704f778c Attempt CI fix 2025-03-12 16:50:55 -07:00
Zai Shi
5c8efbd56a fixed fern imgs 2025-03-12 16:35:56 -07:00
Konstantin Wohlwend
4a52f52721 Fix CI 2025-03-12 14:52:54 -07:00
Konstantin Wohlwend
67dc31687f Fix all-good for PRs 2025-03-12 14:42:12 -07:00
Moritz Schneider
6776af30fd
Active Sessions Page (#528)
<img width="1443" alt="image"
src="https://github.com/user-attachments/assets/611ede72-4d46-41dc-adea-9546c04b199a"
/>

Adds new active sessions page to settings

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Adds an active sessions page to settings, enabling users to view and
manage their sessions, with backend support for session listing and
deletion.
> 
>   - **Active Sessions Page**:
> - Adds `ActiveSessionsPage` component in `account-settings.tsx` to
display active sessions.
> - Allows revoking individual sessions or all sessions except the
current one.
>   - **Backend Changes**:
> - Adds `sessionsCrudHandlers` in `crud.tsx` for session management
(list, delete).
> - Updates `ProjectUserRefreshToken` model in `schema.prisma` to
include `id` and `isImpersonation` fields.
> - Implements session listing and deletion in `serverInterface.ts` and
`client-app-impl.ts`.
>   - **Error Handling**:
> - Introduces `CannotDeleteCurrentSession` error in `known-errors.tsx`.
>   - **Testing**:
> - Adds tests for session management in
`endpoints/api/v1/auth/sessions` tests.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for ba78df0928. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: TheCactusBlue <thecactusblue@gmail.com>
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-12 22:35:32 +01:00
Shridhar Deshmukh
85698aed70
ref: use commander for arguments parsing (#531)
- fixes https://github.com/stack-auth/stack-auth/issues/530

Adding [commander](https://github.com/tj/commander.js) to parse CLI
arguments and options. Commander auto generates a help section based on
configured options.

Both `npx @stackframe/init-stack` and `npx @stacframe/init-stack --next`
both should initialize auth in working directory


```bash
➜  init-stack git:(dev) ✗ node dist/index.js --version
2.7.25
➜  init-stack git:(dev) ✗ node dist/index.js --help
Usage: @stackframe/init-stack [project-path] [options]

Stack Auth Initialization Tool

Arguments:
  project-path   Path to your project

Options:
  -V, --version  output the version number
  --dry-run      Run without making any changes
  --neon         Use Neon database
  --js           Initialize for JavaScript project
  --next         Initialize for Next.js project
  --npm          Use npm as package manager
  --yarn         Use yarn as package manager
  --pnpm         Use pnpm as package manager
  --bun          Use bun as package manager
  --client       Initialize client-side only
  --server       Initialize server-side only
  --no-browser   Don't open browser for environment variable setup
  -h, --help     display help for command

For more information, please visit https://docs.stack-auth.com/getting-started/setup
```

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Replaces manual CLI argument parsing with `commander` in `init-stack`,
simplifying code and auto-generating help text.
> 
>   - **Behavior**:
> - Replaces manual CLI argument parsing with `commander` in `index.ts`.
> - Automatically generates help and version output using `commander`.
> - Supports options like `--dry-run`, `--neon`, `--js`, `--next`,
`--npm`, `--yarn`, `--pnpm`, `--bun`, `--client`, `--server`,
`--no-browser`.
>   - **Dependencies**:
> - Adds `commander` as a dependency in `package.json` and
`packages/init-stack/package.json`.
>   - **Code Cleanup**:
>     - Removes manual argument parsing logic from `index.ts`.
> - Simplifies `main()` function by using `commander` to handle options.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 4d4e2a8324. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-03-12 22:17:19 +01:00
Konstantin Wohlwend
8cc3393110 GH Actions push trigger only on main or dev branches 2025-03-12 10:52:35 -07:00
Konstantin Wohlwend
bd687e8c43 Re-add pull request trigger to GH Actions 2025-03-12 10:43:36 -07:00
Konstantin Wohlwend
474dc4efe1 chore: update package versions 2025-03-12 10:28:45 -07:00
Konstantin Wohlwend
5ae3603f5e Demo page now centers sign in component 2025-03-12 10:07:43 -07:00
Zai Shi
ae69348f52 added dev:docs 2025-03-11 17:10:28 -07:00
devin-ai-integration[bot]
cec3c78999
Update OpenAPI schema generator to support multiple status codes (#527)
Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
2025-03-10 14:50:11 -07:00
CactusBlue
ef6248dd87
Option for merging/blocking account creations with same email but different oauth provider (#502)
* Add SettingSelect component and sign-up mode configuration

* update schema

* update schema

* add merge oauth schema fields

* update test snapshots

* reformat the file

* add mergeOauthMethods in the UI

* Improve documentation with minor enhancements and fixes (#466)

* Improve PATCH /users/me performance

* Neon domain (#488)

* React setup docs (#491)

* chore: update package versions

* Update branding from Stack to Stack Auth in documentation (#504)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: zai@stack-auth.com <zai@stack-auth.com>

* Improve inner OAuth cookie error description

* Fix tests

* Add several spans

* Fix Next.js navigation

* chore: update package versions

* add handler config

* Fix conditional hooks in account settings page

* Add `pnpm run claude-code`

* Fixed docs image ratio (#507)

* Documentation Updates (#508)

* add links

* moar

* fix broken links

* fixed images

* updated readme

* Add Python SDK tab to docs

* Fix broken links

* Prefix `pnpm pre` before `pnpm dev`

* Automatically update pull request branches (#509)

* Give PR updater more permissions

* Ignore PR merge conflicts in GH Actions

* [DEVIN: Konsti] Add userCount property to Project table with automatic update trigger (#506)

Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>

* chore: update package versions

* rewrite as toMatchobject

* fix test

* test again

* fix

* update claude

* fix migrations

* fix migration

* fix types

* Update CLAUDE.md

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>

* more instructions

* fix

* what was i on

* wew

* factor things

* correct the flow

* Update apps/backend/src/app/api/latest/auth/oauth/callback/[provider_id]/route.tsx

Very good catch

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* rename everything

* fix more

* fix typeerror

* update all the tests

* modify migration for legacy projects

* add loading state

* enable email verification for tests

* update test

* get a failing test

* the test works now

* remove debug console log

* change error

* no lowercase

* use typedToUpper/Lowercase

* capture err

* fix types

* modify error throw

* fixed

* add working tests

* documentation update

* Update apps/e2e/tests/backend/endpoints/api/v1/auth/oauth/merge-strategy.test.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* remove eslint rule

* fix json args

* documentation update

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
Co-authored-by: Zai Shi <zaishi00@outlook.com>
Co-authored-by: zai@stack-auth.com <zai@stack-auth.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-10 21:25:12 +00:00
Konstantin Wohlwend
7c3c4863ab Fix GitHub Actions concurrency 2025-03-10 14:09:09 -07:00
Konstantin Wohlwend
1f10e26139 Fix GH Actions concurrency 2025-03-10 14:07:59 -07:00
Konstantin Wohlwend
a2dbecb606 Cancel in-progress GitHub Actions on feature branches 2025-03-10 12:14:58 -07:00
Konstantin Wohlwend
7f2a378286 Run E2E tests only once 2025-03-10 12:10:06 -07:00