diff --git a/.env b/.env old mode 100755 new mode 100644 diff --git a/.env.local b/.env.local old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/package-lock.json b/package-lock.json old mode 100755 new mode 100644 diff --git a/package.json b/package.json old mode 100755 new mode 100644 diff --git a/public/favicon.png b/public/favicon.png old mode 100755 new mode 100644 diff --git a/public/index.html b/public/index.html old mode 100755 new mode 100644 diff --git a/public/manifest.json b/public/manifest.json old mode 100755 new mode 100644 diff --git a/public/robots.txt b/public/robots.txt old mode 100755 new mode 100644 diff --git a/public/static/icons/android-chrome-192x192.png b/public/static/icons/android-chrome-192x192.png old mode 100755 new mode 100644 diff --git a/public/static/icons/android-chrome-512x512.png b/public/static/icons/android-chrome-512x512.png old mode 100755 new mode 100644 diff --git a/public/static/icons/apple-touch-icon.png b/public/static/icons/apple-touch-icon.png old mode 100755 new mode 100644 diff --git a/public/static/icons/favicon-16x16.png b/public/static/icons/favicon-16x16.png old mode 100755 new mode 100644 diff --git a/public/static/icons/favicon-32x32.png b/public/static/icons/favicon-32x32.png old mode 100755 new mode 100644 diff --git a/public/static/icons/favicon.ico b/public/static/icons/favicon.ico old mode 100755 new mode 100644 diff --git a/public/static/icons/mstile-150x150.png b/public/static/icons/mstile-150x150.png old mode 100755 new mode 100644 diff --git a/public/static/img/no-image.png b/public/static/img/no-image.png old mode 100755 new mode 100644 diff --git a/src/Constants.sass b/src/Constants.sass old mode 100755 new mode 100644 diff --git a/src/api/api.ts b/src/api/api.ts old mode 100755 new mode 100644 index c94b5f8..93cd193 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -1,4 +1,4 @@ -const baseUrl = process.env.NODE_ENV === "development" ? 'http://localhost:8080/v1' : 'https://api.unmei.nix13.pw/v1'; +const baseUrl = process.env.NODE_ENV === "development" ? 'http://localhost:8080/v1' : 'https://api.unmei.space/v1'; const response = async (url: string, method: string, body?: string | FormData) => { let bUrl = baseUrl; @@ -41,4 +41,4 @@ const TranslateStatus: { [id: string]: string } = { export const getVersion = () => get('version'); export const version = '0.10'; -export { get, post, put, del, TranslateStatus }; \ No newline at end of file +export { get, post, put, del, TranslateStatus }; diff --git a/src/api/auth.ts b/src/api/auth.ts old mode 100755 new mode 100644 index bbe38ba..2d92a8c --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -1,3 +1,6 @@ import {post} from "./api"; -export const restore = (token: string, new_password: string) => post('auth/restore', { token, new_password }); \ No newline at end of file +export const restore = (token: string, new_password: string) => post('auth/restore', { token, new_password }); +export const registerUser = (login: string, password: string, email: string, recaptcha: string) => post('auth/register', { login, password, email, recaptcha }); +export const login = (login: string, password: string, recaptcha: string) => post('auth/login', { login, password, recaptcha }); +export const userLogout = () => post('auth/logout'); diff --git a/src/api/characters.ts b/src/api/characters.ts old mode 100755 new mode 100644 diff --git a/src/api/errors.ts b/src/api/errors.ts old mode 100755 new mode 100644 diff --git a/src/api/news.ts b/src/api/news.ts old mode 100755 new mode 100644 diff --git a/src/api/novels.ts b/src/api/novels.ts old mode 100755 new mode 100644 diff --git a/src/api/users.ts b/src/api/users.ts old mode 100755 new mode 100644 index 062f44f..1e5f14a --- a/src/api/users.ts +++ b/src/api/users.ts @@ -8,10 +8,6 @@ export const updateUser = (user: UserType) => put(`users/${user.id}`, { user }) export const fetchCurrentUser = () => get('users/me'); export const fetchUserNovels = (id: number) => get(`users/${id}/novels`); -export const registerUser = (login: string, password: string, email: string, recaptcha: string) => post('auth/register', { login, password, email, recaptcha }); -export const login = (login: string, password: string, recaptcha: string) => post('auth/login', { login, password, recaptcha }); -export const userLogout = () => post('auth/logout'); - export const activateAccount = (token: string) => post('auth/activate', { token }); export const generateActivateLink = () => post('auth/activateToken'); @@ -19,4 +15,4 @@ export const fetchUserSettings = () => get('users/me/settings'); export const updateUserSettings = (use_gravatar: boolean, avatar: string) => post('users/me/settings', { use_gravatar, avatar }); export const uploadAvatar = (avatar: FormData) => post('users/me/avatar', avatar); -export const generateRestoreLink = (email: string, recaptcha: string) => post('auth/restoreToken', { email, recaptcha }); \ No newline at end of file +export const generateRestoreLink = (email: string, recaptcha: string) => post('auth/restoreToken', { email, recaptcha }); diff --git a/src/classNames.ts b/src/classNames.ts old mode 100755 new mode 100644 diff --git a/src/index.tsx b/src/index.tsx old mode 100755 new mode 100644 diff --git a/src/pages/ActivateAccount.tsx b/src/pages/ActivateAccount.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/AdminPanel.sass b/src/pages/AdminPanel/AdminPanel.sass old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/AdminPanel.tsx b/src/pages/AdminPanel/AdminPanel.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/News/APModifyPost.tsx b/src/pages/AdminPanel/News/APModifyPost.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/News/APNews.sass b/src/pages/AdminPanel/News/APNews.sass old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/News/APNews.tsx b/src/pages/AdminPanel/News/APNews.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/Novels/AdminPanelNovels.tsx b/src/pages/AdminPanel/Novels/AdminPanelNovels.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/Users/APUser.sass b/src/pages/AdminPanel/Users/APUser.sass old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/Users/AdminPanelUsers.tsx b/src/pages/AdminPanel/Users/AdminPanelUsers.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/Users/ModifyUser.tsx b/src/pages/AdminPanel/Users/ModifyUser.tsx old mode 100755 new mode 100644 diff --git a/src/pages/App/App.sass b/src/pages/App/App.sass old mode 100755 new mode 100644 diff --git a/src/pages/App/App.tsx b/src/pages/App/App.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Character/Character.sass b/src/pages/Character/Character.sass old mode 100755 new mode 100644 diff --git a/src/pages/Character/Character.tsx b/src/pages/Character/Character.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Comments/Comments.sass b/src/pages/Comments/Comments.sass old mode 100755 new mode 100644 diff --git a/src/pages/Comments/Comments.tsx b/src/pages/Comments/Comments.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Footer/Footer.sass b/src/pages/Footer/Footer.sass old mode 100755 new mode 100644 diff --git a/src/pages/Footer/Footer.tsx b/src/pages/Footer/Footer.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Main/Main.sass b/src/pages/Main/Main.sass old mode 100755 new mode 100644 diff --git a/src/pages/Main/Main.tsx b/src/pages/Main/Main.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Main/News.tsx b/src/pages/Main/News.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Modals/LoginModal.sass b/src/pages/Modals/LoginModal.sass old mode 100755 new mode 100644 diff --git a/src/pages/Modals/LoginModal.tsx b/src/pages/Modals/LoginModal.tsx old mode 100755 new mode 100644 index 5a29c53..dd91a6d --- a/src/pages/Modals/LoginModal.tsx +++ b/src/pages/Modals/LoginModal.tsx @@ -1,6 +1,6 @@ import React, {FormEvent, ChangeEvent} from "react"; import Modal from "../../ui/Modal/Modal"; -import {login} from "../../api/users"; +import {login} from "../../api/auth"; import {connect} from "react-redux"; import {addNotification, hideModal, setModal, setUser} from "../../store/actions"; import './LoginModal.sass' @@ -107,4 +107,4 @@ export default connect(null, setModal: (modal: React.ReactNode | null) => dispatch(setModal(modal)), hideModal: () => dispatch(hideModal()) }) -)(LoginModal); \ No newline at end of file +)(LoginModal); diff --git a/src/pages/Modals/RegisterModal.sass b/src/pages/Modals/RegisterModal.sass old mode 100755 new mode 100644 diff --git a/src/pages/Modals/RegisterModal.tsx b/src/pages/Modals/RegisterModal.tsx old mode 100755 new mode 100644 index ca5bd50..8fefa30 --- a/src/pages/Modals/RegisterModal.tsx +++ b/src/pages/Modals/RegisterModal.tsx @@ -2,7 +2,7 @@ import React from "react"; import Modal from "../../ui/Modal/Modal"; import Recaptcha from '../../ui/Recaptcha/Recaptcha' import './RegisterModal.sass' -import {registerUser} from "../../api/users"; +import {registerUser} from "../../api/auth"; import {connect} from "react-redux"; import {addNotification, setModal} from "../../store/actions"; import NotificationMessage from "../../ui/Notifications/NotificationMessage"; @@ -122,4 +122,4 @@ export default connect(null, addNotification: (notification: React.ReactNode) => dispatch(addNotification(notification)), setModal: (modal: React.ReactNode | null) => dispatch(setModal(modal)) }) -)(RegisterModal); \ No newline at end of file +)(RegisterModal); diff --git a/src/pages/Navbar/Navbar.sass b/src/pages/Navbar/Navbar.sass old mode 100755 new mode 100644 diff --git a/src/pages/Navbar/Navbar.tsx b/src/pages/Navbar/Navbar.tsx old mode 100755 new mode 100644 index 996cfcc..cd8fd04 --- a/src/pages/Navbar/Navbar.tsx +++ b/src/pages/Navbar/Navbar.tsx @@ -1,7 +1,7 @@ import React from "react"; import './Navbar.sass' import {connect} from "react-redux"; -import {userLogout} from "../../api/users"; +import {userLogout} from "../../api/auth"; import {Link} from "react-router-dom"; import {logout, setModal} from "../../store/actions"; import {hasAccessToAdminPanel} from "../../utils"; @@ -108,4 +108,4 @@ export default connect( logout: () => dispatch(logout()), setModal: (modal: React.ReactNode | null) => dispatch(setModal(modal)) }) -)(Navbar); \ No newline at end of file +)(Navbar); diff --git a/src/pages/News/AllNews.tsx b/src/pages/News/AllNews.tsx old mode 100755 new mode 100644 index e1c5396..78822e4 --- a/src/pages/News/AllNews.tsx +++ b/src/pages/News/AllNews.tsx @@ -30,6 +30,7 @@ class AllNews extends React.Component<{}, State> {