[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
@@ -45,23 +45,22 @@ export class UserBoxContainer extends Component<InnerProps> {
private get supportsRegister() {
const integrations = this.props.settings.auth.integrations;
return (
(integrations.facebook.allowRegistration &&
integrations.facebook.enabled) ||
(integrations.google.allowRegistration && integrations.google.enabled) ||
(integrations.local.allowRegistration && integrations.local.enabled) ||
integrations.oidc.some(c => c.allowRegistration && c.enabled)
);
return [
integrations.facebook,
integrations.google,
integrations.local,
integrations.oidc,
].some(i => i.allowRegistration && i.enabled && i.targetFilter.stream);
}
private get weControlAuth() {
const integrations = this.props.settings.auth.integrations;
return (
integrations.facebook.enabled ||
integrations.google.enabled ||
integrations.local.enabled ||
integrations.oidc.some(c => c.enabled)
);
return [
integrations.facebook,
integrations.google,
integrations.local,
integrations.oidc,
].some(i => i.enabled && i.targetFilter.stream);
}
public render() {
@@ -75,7 +74,7 @@ export class UserBoxContainer extends Component<InnerProps> {
if (me) {
return (
<UserBoxAuthenticated
onSignOut={(this.weControlAuth && this.handleSignOut) || undefined}
onSignOut={this.handleSignOut}
username={me.username!}
showLogoutButton={this.supportsLogout}
/>
@@ -91,7 +90,7 @@ export class UserBoxContainer extends Component<InnerProps> {
<Popup
href={`${urls.embed.auth}?view=${view}`}
title="Talk Auth"
features="menubar=0,resizable=0,width=350,height=395,top=200,left=500"
features="menubar=0,resizable=0,width=350,height=450,top=100,left=500"
open={open}
focus={focus}
onFocus={this.handleFocus}
@@ -138,22 +137,30 @@ const enhanced = withSignOutMutation(
local {
enabled
allowRegistration
}
sso {
enabled
allowRegistration
targetFilter {
stream
}
}
oidc {
enabled
allowRegistration
targetFilter {
stream
}
}
google {
enabled
allowRegistration
targetFilter {
stream
}
}
facebook {
enabled
allowRegistration
targetFilter {
stream
}
}
}
}