Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Authentication JWT with Firebase
* App.js - Connected authReducer to the store * navigation/ShopNavigator.js - Imported createSwitchNavigator from react-navigation - Imported new AuthScreen * package.json - Installed expo-linear-gradient to add a gradient background * screens/shop/OrdersScreen.js - Fixed typo - Added a msg if there is no orders * screens/user/UserProductsScreen.js - Added a msg if there is no products for the user * store/actions/orders.js - Updated fetchOrders to fetch using the firebase userId - Updated addOrder to get the token and userId from the store (redux) - Then using the userId and token to post a new order * store/actions/products.js - Updated deleteProduct to use token - Updated fetchProducts to use userId to fetch for the user products - Updated createProduct to use userId and Token - Updated updateProduct to use userId and Token * store/reducers/products.js - Updated the productsReducer to reflect the actions updates * screens/user/AuthScreen.js - Added a new screen to use as the first screen of the app where users can login or sign up. - after login, the user is redirect to the "Shop" screen (our second stack) * store/actions/auth.js * store/reducers/auth.js - Added a new redux to store the user information (userId and token)
- Loading branch information
1 parent
71f9afc
commit 5c54505
Showing
15 changed files
with
991 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = function(api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo'], | ||
}; | ||
module.exports = function (api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo', 'module:react-native-dotenv'], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.