diff --git a/.gitignore b/.gitignore
index a619f0988..f0c3b2a4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,5 +20,7 @@ plugins/*
!plugins/coral-plugin-respect
!plugins/coral-plugin-offtopic
!plugins/coral-plugin-like
+!plugins/coral-plugin-mod
+!plugins/coral-plugin-love
**/node_modules/*
diff --git a/LICENSE b/LICENSE
index 41cbbd5aa..597d8fa73 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2016 Mozilla Foundation
+Copyright 2017 Mozilla Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/README.md b/README.md
index ec952b321..718847d9e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Talk [](https://circleci.com/gh/coralproject/talk)
-Talk is currently in Beta! [Read more about Talk here.](https://coralproject.net/products/talk.html)
+Online comments are broken. Our open-source Talk tool rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here.](https://coralproject.net/products/talk.html)
Third party licenses are available via the `/client/3rdpartylicenses.txt`
endpoint when the server is running with built assets.
diff --git a/client/coral-admin/src/actions/auth.js b/client/coral-admin/src/actions/auth.js
index 89b56d4dc..e50273fa6 100644
--- a/client/coral-admin/src/actions/auth.js
+++ b/client/coral-admin/src/actions/auth.js
@@ -1,7 +1,12 @@
import * as actions from '../constants/auth';
+import * as Storage from 'coral-framework/helpers/storage';
import coralApi from 'coral-framework/helpers/response';
+import {handleAuthToken} from 'coral-framework/actions/auth';
+
+//==============================================================================
+// SIGN IN
+//==============================================================================
-// Log In.
export const handleLogin = (email, password, recaptchaResponse) => dispatch => {
dispatch({type: actions.LOGIN_REQUEST});
const params = {method: 'POST', body: {email, password}};
@@ -9,27 +14,42 @@ export const handleLogin = (email, password, recaptchaResponse) => dispatch => {
params.headers = {'X-Recaptcha-Response': recaptchaResponse};
}
return coralApi('/auth/local', params)
- .then(({user}) => {
+ .then(({user, token}) => {
if (!user) {
+ Storage.removeItem('token');
return dispatch(checkLoginFailure('not logged in'));
}
-
+ dispatch(handleAuthToken(token));
const isAdmin = !!user.roles.filter(i => i === 'ADMIN').length;
dispatch(checkLoginSuccess(user, isAdmin));
})
.catch(error => {
-
if (error.translation_key === 'LOGIN_MAXIMUM_EXCEEDED') {
- dispatch({type: actions.LOGIN_MAXIMUM_EXCEEDED, message: error.translation_key});
+ dispatch({
+ type: actions.LOGIN_MAXIMUM_EXCEEDED,
+ message: error.translation_key
+ });
} else {
dispatch({type: actions.LOGIN_FAILURE, message: error.translation_key});
}
});
};
-const forgotPassowordRequest = () => ({type: actions.FETCH_FORGOT_PASSWORD_REQUEST});
-const forgotPassowordSuccess = () => ({type: actions.FETCH_FORGOT_PASSWORD_SUCCESS});
-const forgotPassowordFailure = () => ({type: actions.FETCH_FORGOT_PASSWORD_FAILURE});
+//==============================================================================
+// FORGOT PASSWORD
+//==============================================================================
+
+const forgotPassowordRequest = () => ({
+ type: actions.FETCH_FORGOT_PASSWORD_REQUEST
+});
+
+const forgotPassowordSuccess = () => ({
+ type: actions.FETCH_FORGOT_PASSWORD_SUCCESS
+});
+
+const forgotPassowordFailure = () => ({
+ type: actions.FETCH_FORGOT_PASSWORD_FAILURE
+});
export const requestPasswordReset = email => dispatch => {
dispatch(forgotPassowordRequest(email));
@@ -38,17 +58,31 @@ export const requestPasswordReset = email => dispatch => {
.catch(error => dispatch(forgotPassowordFailure(error)));
};
-// Check Login
+//==============================================================================
+// CHECK LOGIN
+//==============================================================================
-const checkLoginRequest = () => ({type: actions.CHECK_LOGIN_REQUEST});
-const checkLoginSuccess = (user, isAdmin) => ({type: actions.CHECK_LOGIN_SUCCESS, user, isAdmin});
-const checkLoginFailure = error => ({type: actions.CHECK_LOGIN_FAILURE, error});
+const checkLoginRequest = () => ({
+ type: actions.CHECK_LOGIN_REQUEST
+});
+
+const checkLoginSuccess = (user, isAdmin) => ({
+ type: actions.CHECK_LOGIN_SUCCESS,
+ user,
+ isAdmin
+});
+
+const checkLoginFailure = error => ({
+ type: actions.CHECK_LOGIN_FAILURE,
+ error
+});
export const checkLogin = () => dispatch => {
dispatch(checkLoginRequest());
return coralApi('/auth')
.then(({user}) => {
if (!user) {
+ Storage.removeItem('token');
return dispatch(checkLoginFailure('not logged in'));
}
@@ -60,16 +94,3 @@ export const checkLogin = () => dispatch => {
dispatch(checkLoginFailure(`${error.translation_key}`));
});
};
-
-// LogOut Actions
-
-const logOutRequest = () => ({type: actions.LOGOUT_REQUEST});
-const logOutSuccess = () => ({type: actions.LOGOUT_SUCCESS});
-const logOutFailure = () => ({type: actions.LOGOUT_FAILURE});
-
-export const logout = () => dispatch => {
- dispatch(logOutRequest());
- return coralApi('/auth', {method: 'DELETE'})
- .then(() => dispatch(logOutSuccess()))
- .catch(error => dispatch(logOutFailure(error)));
-};
diff --git a/client/coral-admin/src/constants/auth.js b/client/coral-admin/src/constants/auth.js
index 610b21c89..a0c06f72e 100644
--- a/client/coral-admin/src/constants/auth.js
+++ b/client/coral-admin/src/constants/auth.js
@@ -2,9 +2,7 @@ export const CHECK_LOGIN_REQUEST = 'CHECK_LOGIN_REQUEST';
export const CHECK_LOGIN_SUCCESS = 'CHECK_LOGIN_SUCCESS';
export const CHECK_LOGIN_FAILURE = 'CHECK_LOGIN_FAILURE';
-export const LOGOUT_REQUEST = 'LOGOUT_REQUEST';
-export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
-export const LOGOUT_FAILURE = 'LOGOUT_FAILURE';
+export const LOGOUT = 'LOGOUT';
export const LOGIN_REQUEST = 'LOGIN_REQUEST';
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
diff --git a/client/coral-admin/src/containers/LayoutContainer.js b/client/coral-admin/src/containers/LayoutContainer.js
index 42e2baade..04a83e39b 100644
--- a/client/coral-admin/src/containers/LayoutContainer.js
+++ b/client/coral-admin/src/containers/LayoutContainer.js
@@ -1,20 +1,21 @@
import React, {Component} from 'react';
import {connect} from 'react-redux';
import Layout from '../components/ui/Layout';
-import {checkLogin, handleLogin, logout, requestPasswordReset} from '../actions/auth';
-import {toggleModal as toggleShortcutModal} from '../actions/moderation';
import {fetchConfig} from '../actions/config';
+import {logout} from 'coral-framework/actions/auth';
import {FullLoading} from '../components/FullLoading';
import AdminLogin from '../components/AdminLogin';
+import {toggleModal as toggleShortcutModal} from '../actions/moderation';
+import {checkLogin, handleLogin, requestPasswordReset} from '../actions/auth';
class LayoutContainer extends Component {
- componentWillMount () {
+ componentWillMount() {
const {checkLogin, fetchConfig} = this.props;
checkLogin();
fetchConfig();
}
- render () {
+ render() {
const {
isAdmin,
loggedIn,
@@ -24,19 +25,34 @@ class LayoutContainer extends Component {
passwordRequestSuccess
} = this.props.auth;
- const {handleLogout, toggleShortcutModal, TALK_RECAPTCHA_PUBLIC} = this.props;
- if (loadingUser) { return
{ emailAddress }
- : null - } + {emailAddress ?{emailAddress}
: null} - { - myIgnoredUsersData.myIgnoredUsers && myIgnoredUsersData.myIgnoredUsers.length - ? ( -{lang.t('userNoComment')}
- } + {me.comments.length + ?{lang.t('userNoComment')}
}