1
0
mirror of https://github.com/hyperspacedev/hyperspace synced 2025-02-03 18:57:38 +01:00

Merge pull request #39 from hyperspacedev/login-logic

Fix well-known login caused by faulty check in federation status
This commit is contained in:
Marquis Kurt 2019-04-29 14:55:33 -04:00 committed by GitHub
commit b4c99af026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,10 +137,16 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
}
getLoginUser(user: string) {
if (this.state.federates || user.includes("@")) {
let newUser = user;
this.setState({ user: newUser })
return "https://" + newUser.split("@")[1];
if (user.includes("@")) {
if (this.state.federates) {
let newUser = user;
this.setState({ user: newUser });
return "https://" + newUser.split("@")[1];
} else {
let newUser = `${user}@${this.state.registerBase? this.state.registerBase: "mastodon.social"}`;
this.setState({ user: newUser });
return "https://" + (this.state.registerBase? this.state.registerBase: "mastodon.social");
}
} else {
let newUser = `${user}@${this.state.registerBase? this.state.registerBase: "mastodon.social"}`;
this.setState({ user: newUser });