# Redux 常見問題:其它
## 目錄
- [有 “真實存在” 且很龐大的 Redux 項目嗎?](#miscellaneous-real-projects)
- [如何在 Redux 中實現鑒權?](#miscellaneous-authentication)
## 其他
<a id="miscellaneous-real-projects"></a>
### 有 “真實存在” 且很龐大的 Redux 項目嗎?
存在,并且有很多,比如:
- [Twitter's mobile site](https://twitter.com/necolas/status/727538799966715904)
- [Wordpress's new admin page](https://github.com/Automattic/wp-calypso)
- [Firefox's new debugger](https://github.com/jlongster/debugger.html)
- [Mozilla's experimental browser testbed](https://github.com/mozilla/tofino)
- [The HyperTerm terminal application](https://github.com/zeit/hyperterm)
很多,真的有很多!
#### 補充資料
**文檔**
- [Introduction: Examples](introduction/Examples.md)
**討論**
- [Reddit: Large open source react/redux projects?](https://www.reddit.com/r/reactjs/comments/496db2/large_open_source_reactredux_projects/)
- [HN: Is there any huge web application built using Redux?](https://news.ycombinator.com/item?id=10710240)
<a id="miscellaneous-authentication"></a>
### 如何在 Redux 中實現鑒權?
在任何真正的應用中,鑒權都必不可少。當考慮鑒權時須謹記:不管你怎樣組織應用,都并不會改變什么,你應當像實現其它功能一樣實現鑒權。這實際上很簡單:
1. 為 `LOGIN_SUCCESS`、`LOGIN_FAILURE` 等定義 action 常量。
2. 創建接受憑證的 action 創建函數,憑證是指示身份驗證成功與否的標志、一個令牌、或者作為負載的錯誤信息。
3. 使用 Redux Thunk middleware 或者其它適合于觸發網絡請求(請求 API,如果是合法鑒權則返回令牌)的 middleware 創建一個異步的 action 創建函數。之后在本地存儲中保存令牌或者給用戶一個非法提示。可以通過執行上一步的 action 創建函數達到此效果。
4. 為每個可能出現的鑒權場景(`LOGIN_SUCCESS`、`LOGIN_FAILURE`等)編寫獨立的 reducer。
#### 補充資料
**文章**
- [Authentication with JWT by Auth0](https://auth0.com/blog/2016/01/04/secure-your-react-and-redux-app-with-jwt-authentication/)
- [Tips to Handle Authentication in Redux](https://medium.com/@MattiaManzati/tips-to-handle-authentication-in-redux-2-introducing-redux-saga-130d6872fbe7)
**例子**
- [react-redux-jwt-auth-example](https://github.com/joshgeller/react-redux-jwt-auth-example)
**討論**
- [redux-auth](https://github.com/lynndylanhurley/redux-auth)
- 自述
- 介紹
- 動機
- 核心概念
- 三大原則
- 先前技術
- 學習資源
- 生態系統
- 示例
- 基礎
- Action
- Reducer
- Store
- 數據流
- 搭配 React
- 示例:Todo List
- 高級
- 異步 Action
- 異步數據流
- Middleware
- 搭配 React Router
- 示例:Reddit API
- 下一步
- 技巧
- 配置 Store
- 遷移到 Redux
- 使用對象展開運算符
- 減少樣板代碼
- 服務端渲染
- 編寫測試
- 計算衍生數據
- 實現撤銷重做
- 子應用隔離
- 組織 Reducer
- Reducer 基礎概念
- Reducer 基礎結構
- Reducer 邏輯拆分
- Reducer 重構示例
- combineReducers 用法
- combineReducers 進階
- State 范式化
- 管理范式化數據
- Reducer 邏輯復用
- 不可變更新模式
- 初始化 State
- 結合 Immutable.JS 使用 Redux
- 常見問題
- 綜合
- Reducer
- 組織 State
- 創建 Store
- Action
- 不可變數據
- 代碼結構
- 性能
- 設計哲學
- React Redux
- 其它
- 排錯
- 詞匯表
- API 文檔
- createStore
- Store
- combineReducers
- applyMiddleware
- bindActionCreators
- compose
- react-redux 文檔
- API
- 排錯