mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-13 01:07:42 -05:00
cleaned up admin
This commit is contained in:
@@ -10,7 +10,8 @@ var backend_server = process.env['REACT_APP_BACKEND_SERVER'] != null ? process.e
|
||||
var frontend_server = process.env['REACT_APP_FRONTEND_SERVER'] != null ? process.env['REACT_APP_FRONTEND_SERVER'] : 'https://openmhz.com';
|
||||
var socket_server = process.env['REACT_APP_SOCKET_SERVER'] != null ? process.env['REACT_APP_SOCKET_SERVER'] : 'wss://socket.openmhz.com'; //'https://s3.amazonaws.com/robotastic';
|
||||
var account_server = process.env['REACT_APP_ACCOUNT_SERVER'] != null ? process.env['REACT_APP_ACCOUNT_SERVER'] : 'https://account.openmhz.com'; //'https://s3.amazonaws.com/robotastic';
|
||||
var dev_server = "http://account.openmhz.test:3000"
|
||||
var account_dev_server = "http://account.openmhz.test:3000"
|
||||
var admin_dev_server = "http://admin.openmhz.test:3000"
|
||||
|
||||
module.exports = function(app, passport) {
|
||||
app.set("port", 3009)
|
||||
@@ -65,7 +66,8 @@ module.exports = function(app, passport) {
|
||||
allowedOrigins.push(frontend_server);
|
||||
allowedOrigins.push(backend_server);
|
||||
allowedOrigins.push(socket_server);
|
||||
allowedOrigins.push(dev_server);
|
||||
allowedOrigins.push(admin_dev_server);
|
||||
allowedOrigins.push(account_dev_server);
|
||||
var origin = req.headers.origin;
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ exports.isLoggedIn = function (req, res, next) {
|
||||
|
||||
exports.authenticated = function (req, res, next) {
|
||||
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
|
||||
console.log("account/server/controllers/users.js - exports.authenticated() Auth check for user: " + req.user + " is: " + req.isAuthenticated());
|
||||
console.log("account/server/controllers/users.js - exports.authenticated() Auth check for user: " + req.user.email + " is: " + req.isAuthenticated());
|
||||
if (req.isAuthenticated()) {
|
||||
var clientUser = (({
|
||||
firstName,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { Component } from "react"
|
||||
import React from "react"
|
||||
import Navigation from "./Navigation"
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
|
||||
@@ -15,7 +15,6 @@ import ResetPassword from "../User/ResetPassword"
|
||||
import Terms from "../User/Terms"
|
||||
|
||||
const App = (params) => {
|
||||
const { store } = params;
|
||||
return (
|
||||
<div>
|
||||
<Navigation />
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import { Menu, Dropdown } from "semantic-ui-react";
|
||||
import React, { useEffect } from "react";
|
||||
import { useSelector, useDispatch } from 'react-redux'
|
||||
import { logoutUser } from "../features/user/userSlice";
|
||||
|
||||
const navStyle = {
|
||||
marginBottom: "30px"
|
||||
};
|
||||
const blankStyle = {
|
||||
marginBottom: "50px"
|
||||
};
|
||||
|
||||
const Navigation = (props) => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import { connect } from "react-redux"
|
||||
import * as userActions from "../User/user-actions"
|
||||
import Navigation from "./Navigation"
|
||||
|
||||
|
||||
// Function passed in to `connect` to subscribe to Redux store updates.
|
||||
// Any time it updates, mapStateToProps is called.
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
user: state.user
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Connects React component to the redux store
|
||||
// It does not modify the component class passed to it
|
||||
// Instead, it returns a new, connected component class, for you to use.
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
userActions
|
||||
)(Navigation)
|
||||
@@ -43,7 +43,7 @@ const Login = (props) => {
|
||||
if (result.success) {
|
||||
|
||||
if (nextLocation) {
|
||||
switch (this.props.nextLocation) {
|
||||
switch (nextLocation) {
|
||||
case "frontend":
|
||||
window.location = process.env.REACT_APP_FRONTEND_SERVER;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user