[next] Auth Popup v2 (#2101)

* feat: Implement new Sign In view

* feat: Move forgot + resetPassword to new design

* feat: Implement sign up with new design

* fix: narrow gutter

* test: add unit tests

* test: integration tests

* feat: support show / hide password

* feat: support oauth2 flow

* feat: add views for user completion

* feat: implement oauth2 sign up

* test: fix snapshots

* fix: lint

* fix: get more complete mutation response

* fix: removed array of OIDC integrations

* fix: renamed resolver function

* fix: adapt oidc client implementation

* fix: targetFilter should be stream on signup

* fix: removed unneeded message

* fix: moved password into local profile

* fix: made username optional, removed valid null value

* fix: linting

* fix: respect targetFilter

* feat: support user registration mutations

- Added `setUsername`
- Added `setEmail`
- Added `setPassword`
- Added `permit` to `@auth`
- Added `email` to `User`

* fix: fixed issue with query

* feat: added user password update

* feat: complete sign in mutation

* fix: adapt some rebasing gitches

* test: improve tests

* test: unittest for setting auth token

* fix: failing tests

* test: move most tests from enzyme to react-test-renderer

* fix: remove schema warnings in tests

* test: improve window mock

* test: test different social login configurations

* test: test social logins for sign up

* fix: use htmlFor instead of for

* test: more feature tests

* feat: always go through account completion

* test: feature test account completion

* feat: addtional account completion test

* Update start.ts

* chore: refactor auth token retrieval logic
This commit is contained in:
Kiwi
2018-12-20 22:32:04 +01:00
committed by GitHub
parent 326a10dc5d
commit 065cb4b03a
331 changed files with 12476 additions and 7163 deletions
@@ -1,56 +0,0 @@
import { graphql } from "react-relay";
import { Environment } from "relay-runtime";
import {
commitMutationPromiseNormalized,
createMutationContainer,
} from "talk-framework/lib/relay";
import { Omit } from "talk-framework/types";
import { CreateOIDCAuthIntegrationMutation as MutationTypes } from "talk-admin/__generated__/CreateOIDCAuthIntegrationMutation.graphql";
export type CreateOIDCAuthIntegrationInput = Omit<
MutationTypes["variables"]["input"],
"clientMutationId"
>;
const mutation = graphql`
mutation CreateOIDCAuthIntegrationMutation(
$input: CreateOIDCAuthIntegrationInput!
) {
createOIDCAuthIntegration(input: $input) {
settings {
auth {
...OIDCConfigListContainer_authReadOnly
}
}
clientMutationId
}
}
`;
let clientMutationId = 0;
function commit(
environment: Environment,
input: CreateOIDCAuthIntegrationInput
) {
return commitMutationPromiseNormalized<MutationTypes>(environment, {
mutation,
variables: {
input: {
...input,
clientMutationId: (clientMutationId++).toString(),
},
},
});
}
export const withCreateOIDCAuthIntegrationMutation = createMutationContainer(
"createOIDCAuthIntegration",
commit
);
export type CreateOIDCAuthIntegrationMutation = (
input: CreateOIDCAuthIntegrationInput
) => Promise<MutationTypes["response"]["createOIDCAuthIntegration"]>;
@@ -1,56 +0,0 @@
import { graphql } from "react-relay";
import { Environment } from "relay-runtime";
import {
commitMutationPromiseNormalized,
createMutationContainer,
} from "talk-framework/lib/relay";
import { Omit } from "talk-framework/types";
import { UpdateOIDCAuthIntegrationMutation as MutationTypes } from "talk-admin/__generated__/UpdateOIDCAuthIntegrationMutation.graphql";
export type UpdateOIDCAuthIntegrationInput = Omit<
MutationTypes["variables"]["input"],
"clientMutationId"
>;
const mutation = graphql`
mutation UpdateOIDCAuthIntegrationMutation(
$input: UpdateOIDCAuthIntegrationInput!
) {
updateOIDCAuthIntegration(input: $input) {
settings {
auth {
...OIDCConfigListContainer_authReadOnly
}
}
clientMutationId
}
}
`;
let clientMutationId = 0;
function commit(
environment: Environment,
input: UpdateOIDCAuthIntegrationInput
) {
return commitMutationPromiseNormalized<MutationTypes>(environment, {
mutation,
variables: {
input: {
...input,
clientMutationId: (clientMutationId++).toString(),
},
},
});
}
export const withUpdateOIDCAuthIntegrationMutation = createMutationContainer(
"updateOIDCAuthIntegration",
commit
);
export type UpdateOIDCAuthIntegrationMutation = (
input: UpdateOIDCAuthIntegrationInput
) => Promise<MutationTypes["response"]["updateOIDCAuthIntegration"]>;
@@ -25,8 +25,8 @@ const mutation = graphql`
...GoogleConfigContainer_authReadOnly
...SSOConfigContainer_auth
...SSOConfigContainer_authReadOnly
...OIDCConfigListContainer_auth
...OIDCConfigListContainer_authReadOnly
...OIDCConfigContainer_auth
...OIDCConfigContainer_authReadOnly
...DisplayNamesConfigContainer_auth
}
}
-8
View File
@@ -20,11 +20,3 @@ export {
withRegenerateSSOKeyMutation,
RegenerateSSOKeyMutation,
} from "./RegenerateSSOKeyMutation";
export {
withCreateOIDCAuthIntegrationMutation,
CreateOIDCAuthIntegrationMutation,
} from "./CreateOIDCAuthIntegrationMutation";
export {
withUpdateOIDCAuthIntegrationMutation,
UpdateOIDCAuthIntegrationMutation,
} from "./UpdateOIDCAuthIntegrationMutation";