Skip to content

Commit 59cb1e7

Browse files
author
vikasrohit
authored
Merge pull request #308 from appirio-tech/feature/connectv2_sso_login
Support for auto filling user info for SSO user
2 parents 244517c + edf41f9 commit 59cb1e7

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

components/LoginScreen/index.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ class LoginScreen extends Component {
102102
/>
103103
<a href={vm.forgotPasswordUrl} className="bottom-link">Forgot your password?</a>
104104
<button type="submit" className="tc-btn tc-btn-sm tc-btn-primary flex middle center" disabled={vm.loading || !this.state.canSubmit}>Log in</button>
105+
106+
{ vm.ssoLoginUrl && (
107+
<a className="sso-link" href={vm.ssoLoginUrl}>
108+
<span>Single Sign On</span>
109+
</a>)
110+
}
105111
</Formsy.Form>
106112
<p className="copyright">© Topcoder 2018</p>
107113
</div>

components/LoginScreen/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
}
4141
}
4242

43+
.sso-link {
44+
margin-top: 10px;
45+
}
46+
4347
.top-logo {
4448
z-index: 1;
4549
top: 20px;

components/RegistrationScreen/index.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ class RegistrationScreen extends Component {
106106

107107
render() {
108108
const {vm} = this.props
109+
let preFillName = vm.firstName ? vm.firstName : null
110+
preFillName = vm.lastName ? `${preFillName} ${vm.lastName}` : preFillName
111+
const preFillEmail = vm.email ? vm.email : null
109112
return (
110113
<div className="RegistrationScreen flex column middle center">
111114
<div className="container flex column middle center">
@@ -121,12 +124,15 @@ class RegistrationScreen extends Component {
121124
validationError="Please enter name"
122125
required
123126
showCheckMark
127+
value={preFillName}
124128
/>
125129
<TextInput
126130
wrapperClass={'input-container'}
127131
label="Business email"
128132
type="email"
129133
name="email"
134+
value={preFillEmail}
135+
disabled={!!preFillEmail}
130136
validations="isEmail"
131137
validationError="Invalid business email"
132138
required
@@ -196,7 +202,7 @@ class RegistrationScreen extends Component {
196202
validator={vm.usernameIsFree}
197203
showCheckMark
198204
/>
199-
<PasswordInput
205+
{ !vm.ssoUser && <PasswordInput
200206
wrapperClass={'input-container'}
201207
label="Create a password (8–64 characters, A–Z, 0–9, . _ - ! ? allowed)"
202208
name="password"
@@ -215,6 +221,7 @@ class RegistrationScreen extends Component {
215221
required
216222
showCheckMark
217223
/>
224+
}
218225
<Checkbox
219226
wrapperClass={'input-container'}
220227
label="I agree to receive other communications from Topcoder."

0 commit comments

Comments
 (0)