mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
update
This commit is contained in:
parent
3605540bdd
commit
bca9bcf12b
@ -377,7 +377,7 @@ export const renderedOrganizationConfigToProjectCrud = (renderedConfig: Organiza
|
||||
return undefined;
|
||||
}
|
||||
return filterUndefined({
|
||||
provider_id: oauthProviderId,
|
||||
provider_config_id: oauthProviderId,
|
||||
id: oauthProvider.type,
|
||||
type: oauthProvider.isShared ? 'shared' : 'standard',
|
||||
client_id: oauthProvider.clientId,
|
||||
|
||||
@ -62,12 +62,12 @@ it("should be able to provision a new project if client details are correct", as
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "github",
|
||||
"provider_id": "github",
|
||||
"provider_config_id": "github",
|
||||
"type": "shared",
|
||||
},
|
||||
{
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
|
||||
@ -113,7 +113,7 @@ it("lists oauth providers", async ({ expect }) => {
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
|
||||
@ -62,12 +62,12 @@ it("should be able to provision a new project if neon client details are correct
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "github",
|
||||
"provider_id": "github",
|
||||
"provider_config_id": "github",
|
||||
"type": "shared",
|
||||
},
|
||||
{
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
|
||||
@ -182,7 +182,7 @@ it("creates a new project with different configurations", async ({ expect }) =>
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
|
||||
@ -21,7 +21,7 @@ it("should create an OAuth provider connection", async ({ expect }: { expect: an
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -58,7 +58,7 @@ it("should read an OAuth provider connection", async ({ expect }: { expect: any
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -101,7 +101,7 @@ it("should list all OAuth provider connections for a user", async ({ expect }: {
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -150,7 +150,7 @@ it("should update an OAuth provider connection on the client", async ({ expect }
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -195,7 +195,7 @@ it("should update an OAuth provider connection on the server", async ({ expect }
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -243,7 +243,7 @@ it("should delete an OAuth provider connection", async ({ expect }: { expect: an
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -351,7 +351,7 @@ it("should forbid client access to other users' OAuth providers", async ({ expec
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
const user1 = await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -359,7 +359,7 @@ it("should forbid client access to other users' OAuth providers", async ({ expec
|
||||
accessType: "server",
|
||||
body: {
|
||||
user_id: "me",
|
||||
provider_id: providerConfig.id,
|
||||
provider_config_id: providerConfig.id,
|
||||
account_id: "test_github_user_1",
|
||||
email: "test1@example.com",
|
||||
allow_sign_in: true,
|
||||
@ -470,7 +470,7 @@ it("should allow server access to any user's OAuth providers", async ({ expect }
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
const user1 = await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse1 = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -613,7 +613,7 @@ it("should handle account_id updates correctly", async ({ expect }: { expect: an
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -738,7 +738,7 @@ it("should toggle sign-in and connected accounts capabilities", async ({ expect
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
const createResponse = await niceBackendFetch("/api/v1/oauth-providers", {
|
||||
@ -804,7 +804,7 @@ it("should prevent multiple providers of the same type from being enabled for si
|
||||
const { createProjectResponse } = await createAndSwitchToOAuthEnabledProject();
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_id === "github");
|
||||
const providerConfig = createProjectResponse.body.config.oauth_providers.find((p: any) => p.provider_config_id === "github");
|
||||
expect(providerConfig).toBeDefined();
|
||||
|
||||
// Create first GitHub account connection with sign-in enabled
|
||||
|
||||
@ -758,7 +758,7 @@ it("updates the project oauth configuration", async ({ expect }) => {
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
@ -808,7 +808,7 @@ it("updates the project oauth configuration", async ({ expect }) => {
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
@ -862,7 +862,7 @@ it("updates the project oauth configuration", async ({ expect }) => {
|
||||
"client_id": "client_id",
|
||||
"client_secret": "client_secret",
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "standard",
|
||||
},
|
||||
],
|
||||
@ -911,7 +911,7 @@ it("updates the project oauth configuration", async ({ expect }) => {
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "spotify",
|
||||
"provider_id": "spotify",
|
||||
"provider_config_id": "spotify",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
@ -970,12 +970,12 @@ it("updates the project oauth configuration", async ({ expect }) => {
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "shared",
|
||||
},
|
||||
{
|
||||
"id": "spotify",
|
||||
"provider_id": "spotify",
|
||||
"provider_config_id": "spotify",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
@ -1034,12 +1034,12 @@ it("updates the project oauth configuration", async ({ expect }) => {
|
||||
"oauth_providers": [
|
||||
{
|
||||
"id": "google",
|
||||
"provider_id": "google",
|
||||
"provider_config_id": "google",
|
||||
"type": "shared",
|
||||
},
|
||||
{
|
||||
"id": "spotify",
|
||||
"provider_id": "spotify",
|
||||
"provider_config_id": "spotify",
|
||||
"type": "shared",
|
||||
},
|
||||
],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user