Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link cognito sdk #182

Merged
merged 35 commits into from
Jan 25, 2018
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c14a563
add cognito js lib and update references
mlabieniec Jan 21, 2018
6d4a453
update cognito lib
mlabieniec Jan 21, 2018
003faf9
update node version and package deps
mlabieniec Jan 21, 2018
7e3a0aa
update cognito sdk and auth test
mlabieniec Jan 21, 2018
c49bf93
update travis commands
mlabieniec Jan 21, 2018
ca7af40
update react tests
mlabieniec Jan 21, 2018
1575007
update travis
mlabieniec Jan 21, 2018
21c21cf
update with yarn workspaces and modules
mlabieniec Jan 21, 2018
ad01d68
update with yarn workspaces and modules
mlabieniec Jan 21, 2018
cc4ea8c
add lint to test
mlabieniec Jan 21, 2018
9815b58
update test cmd
mlabieniec Jan 21, 2018
f0a8f4e
update test cmd
mlabieniec Jan 21, 2018
9c4a156
update test cmd
mlabieniec Jan 21, 2018
7e108cc
update build cmds
mlabieniec Jan 21, 2018
53ae905
update concurrency with bootstrap
mlabieniec Jan 21, 2018
aa42256
set yarn workspaces
mlabieniec Jan 21, 2018
0039df0
update travis
mlabieniec Jan 21, 2018
8b757d1
update deps, yarn should use local
mlabieniec Jan 21, 2018
cea0a55
remove workspaces
mlabieniec Jan 21, 2018
4bb9afe
update workspaces
mlabieniec Jan 21, 2018
86808d6
add build before test for workspaces
mlabieniec Jan 21, 2018
b81ca93
update travis
mlabieniec Jan 21, 2018
5aef562
remove package-lock.json
mlabieniec Jan 21, 2018
ce7d6c2
update rn package
mlabieniec Jan 21, 2018
e2ab699
update deps on react native
mlabieniec Jan 22, 2018
8b4d307
update user attributes
mlabieniec Jan 22, 2018
9161b6e
update user attributes
mlabieniec Jan 22, 2018
20dfa6c
fix variable
mlabieniec Jan 22, 2018
cc0711e
update docs
mlabieniec Jan 22, 2018
2167eab
Merge branch 'link-cognito-sdk' of github.com:mlabieniec/aws-amplify …
mlabieniec Jan 22, 2018
632efa1
for rn
powerful23 Jan 23, 2018
ff04b58
core change
powerful23 Jan 23, 2018
6ec5a8b
Merge pull request #2 from powerful235/master
mlabieniec Jan 23, 2018
bcc1f9e
Update package.json
mlabieniec Jan 24, 2018
64607d1
Adds a podspec for CocoaPods support
mlabieniec Jan 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: node_js
sudo: false
node_js:
- 6
- 8
install:
- npm install
- yarn config set workspaces-experimental true
- yarn
script:
- npm run bootstrap
- npm run lint
- npm run test
- npm run coverage
- npm run build
- npm run docs
- yarn bootstrap
- yarn build
- yarn test --scope aws-amplify
- yarn test --scope aws-amplify-react
- yarn coverage
4 changes: 3 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"lerna": "2.4.0",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*"
],
"version": "0.0.0"
"version": "independent"
}
50 changes: 46 additions & 4 deletions media/authentication_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The AWS Amplify Auth module provides Authentication APIs and building blocks to
- [4. Compose Authenticator](#4-compose-authenticator)
- [5. Write Your Own Auth UI](#5-write-your-own-auth-ui)
- [6. Federated Identity](#6-federated-identity)
- [7. User Attributes](#6-user-attributes)
* [Extension](#extension)
- [UI Theme](#ui-theme)
- [Error Message](#error-message)
Expand Down Expand Up @@ -74,10 +75,13 @@ import { Auth } from 'aws-amplify';
Auth.signUp({
username,
password,
email, // optional
phone, // optional
// other custom attributes if has been set in Cognito
// myAttr: ...
attributes: {
email, // optional
phone, // optional
// other custom attributes if has been set in Cognito
// myAttr: ...
},
validationData: [] //optional
})
.then(data => console.log(data))
.catch(err => console.log(err));
Expand Down Expand Up @@ -143,6 +147,44 @@ const federated = {
ReactDOM.render(<AppWithAuth federated={federated}/>, document.getElementById('root'));
```

#### User Attributes

You can pass in any user attributes during sign in:

```js
Auth.signUp({
'username': 'jdoe',
'password': 'mysecurerandompassword#123',
'email': 'me@domain.com',
'phone_number': '+12128601234',
'first_name': 'Jane',
'last_name': 'Doe',
'nick_name': 'Jane'
});
```

You can retrieve user attributes:

```js
let profile = await Auth.currentUserInfo();
```

You can then update the user attributes:

```js
let result = await Auth.updateUserAttributes({
'email': 'me@anotherdomain.com',
'last_name': 'Lastname'
});
console.log(result); // SUCCESS
```

If you change the email address you will receive a confirmation code to that email and you can confirm it with the code:

```js
let result = await Auth.verifyCurrentUserAttributeSubmit('email',abc123);
```

#### Sign Out Button

The default `withAuthenticator` renders just the App component after a user is signed in, preventing interference with your app. Then question comes, how does the user sign out?
Expand Down
Loading