mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-11 09:32:51 +00:00
client - add error message if user account does not have battletag
This commit is contained in:
54
README.md
54
README.md
@@ -77,6 +77,8 @@ mix local.hex
|
||||
- Check out `.exguard.exs` for configuration.
|
||||
|
||||
# Postgres setup
|
||||
[Setup on Centos7](https://linode.com/docs/databases/postgresql/how-to-install-postgresql-relational-databases-on-centos-7/)
|
||||
|
||||
Change password to postgres user
|
||||
```
|
||||
sudo -u user_name psql db_name
|
||||
@@ -120,3 +122,55 @@ https://localhost {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# Hosting on Vultr
|
||||
|
||||
### Centos setup from scratch
|
||||
[Enable private networking](https://www.vultr.com/docs/configuring-private-network)
|
||||
```
|
||||
/etc/sysconfig/network-scripts/ifcfg-eth1
|
||||
|
||||
DEVICE=eth1
|
||||
ONBOOT=yes
|
||||
NM_CONTROLLED=no
|
||||
BOOTPROTO=static
|
||||
IPADDR=<ip>
|
||||
NETMASK=<netmask>
|
||||
IPV6INIT=no
|
||||
MTU=1450
|
||||
```
|
||||
|
||||
Disable firewalld (make sure firewall is enabled in vultr config)
|
||||
```
|
||||
systemctl disable firewalld
|
||||
```
|
||||
|
||||
Install and start postgresql
|
||||
```
|
||||
sudo yum install postgresql-server postgresql-contrib
|
||||
sudo postgresql-setup initdb
|
||||
sudo systemctl start postgresql
|
||||
sudo systemctl enable postgresql
|
||||
```
|
||||
|
||||
Configure user
|
||||
```
|
||||
sudo passwd postgres
|
||||
su postgres
|
||||
psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'newpassword';"
|
||||
```
|
||||
|
||||
|
||||
Allow connections on all interfaces
|
||||
```
|
||||
/var/lib/pgsql/data/postgresql.conf
|
||||
|
||||
listen_address='*'
|
||||
```
|
||||
|
||||
```
|
||||
/var/lib/pgsql/data/pg_hba.conf
|
||||
|
||||
host all all 0.0.0.0/0 md5
|
||||
```
|
||||
|
||||
|
||||
2
client/.gitignore
vendored
2
client/.gitignore
vendored
@@ -2,3 +2,5 @@
|
||||
node_modules
|
||||
yarn-error*
|
||||
dist
|
||||
prod_ssh_key
|
||||
copy_build_prod.sh
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
import React from 'react';
|
||||
import { RouteComponentProps } from 'react-router-dom';
|
||||
import { parse } from 'query-string';
|
||||
import { ContentContainer } from '../../components';
|
||||
import { UserService } from '../../services';
|
||||
|
||||
interface Props extends RouteComponentProps<any> {}
|
||||
|
||||
interface State {}
|
||||
interface State {
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export class Oauth extends React.Component<Props, State> {
|
||||
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.login(this.props.location.search);
|
||||
}
|
||||
@@ -17,14 +26,19 @@ export class Oauth extends React.Component<Props, State> {
|
||||
const code = parse(queryString).code;
|
||||
await UserService.authorize(code);
|
||||
window.opener.location.reload();
|
||||
// TODO: this doesn't work on mobile currently
|
||||
window.close();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
this.setState({
|
||||
errorMessage: 'Unable to log in. Your account may not be in the right region, or you may not have set a battletag.',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div />;
|
||||
return (
|
||||
<ContentContainer style={{ minHeight: '500px', padding: '50px', textAlign: 'center' }}>
|
||||
<b>{this.state.errorMessage}</b>
|
||||
</ContentContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,9 +198,8 @@ export class UserAccount extends React.Component<Props, State> {
|
||||
|
||||
{noCharacters &&
|
||||
<div>
|
||||
<p>Unable to fetch your characters.
|
||||
<p>Unable to fetch your characters.</p>
|
||||
<a onClick={() => this.setState({ region: 'eu' }, () => this.getCharacters())}>EU account?</a>
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ config :myapp, MyAppWeb.Endpoint,
|
||||
# Configure your database
|
||||
config :myapp, MyApp.Repo,
|
||||
adapter: Ecto.Adapters.Postgres,
|
||||
hostnamae: "localhost",
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
database: "myapp_prod",
|
||||
|
||||
Reference in New Issue
Block a user