Guest User

Untitled

a guest
May 7th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. ## Enable debug log
  2.  
  3. ```js
  4. window.LOG_LEVEL = 'DEBUG';
  5. ```
  6.  
  7. ## Disable analytics
  8.  
  9. The noise in the debug logs is insane:
  10.  
  11. ```js
  12. import { Analytics } from 'aws-amplify';
  13.  
  14. Analytics.disable();
  15. ```
  16.  
  17. ## Manual Configuration
  18.  
  19. ```js
  20. import Amplify,{Auth} from 'aws-amplify';
  21.  
  22. Amplify.configure({
  23. Auth: {
  24. identityPoolId: '...',
  25. region: '...',
  26. userPoolId: '...',
  27. userPoolWebClientId: '...',
  28. }
  29. });
  30. ```
  31.  
  32. ## Sign Up
  33.  
  34. ```js
  35. const phone = this.state.phone.trim();
  36.  
  37. var attributes = {
  38. email: email,
  39. name: fullname
  40. }
  41.  
  42. if (phone) {
  43. attributes['phone_number'] = phone;
  44. }
  45.  
  46. Auth.signUp({
  47. username: username,
  48. password: password,
  49. attributes: attributes
  50. })
  51. .then(
  52. this.setState(() => {
  53. return {
  54. enterAuth: true
  55. }
  56. })
  57. )
  58. .catch( err => {
  59. console.log(username, password, email, phone, fullname);
  60. console.log(err);
  61. })
  62. ```
Add Comment
Please, Sign In to add comment