Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,6 @@ const routes = [
}
]
},
{
path: 'admin',
component: lazyLoad('dashboard/admin/AdminRoot'),
redirect: '/dashboard/admin/online-devices',
children: [
{
path: 'users',
component: lazyLoad('dashboard/admin/users/Users')
},
{
path: 'online-devices',
component: lazyLoad('dashboard/admin/online-devices/OnlineDevices')
}
]
},
{
path: 'profile',
component: lazyLoad('dashboard/profile/ProfileRoot'),
Expand All @@ -83,24 +68,9 @@ const routes = [
path: 'account',
component: lazyLoad('dashboard/profile/Account')
},
{
path: 'settings',
component: lazyLoad('dashboard/profile/Settings')
},
{
path: 'license',
component: lazyLoad('dashboard/profile/License')
},
{
path: "connections",
component: lazyLoad('dashboard/profile/connections/ConnectionsRoot'),
redirect: '/dashboard/profile/settings',
children: [
{
path: "patreon",
component: lazyLoad('dashboard/profile/connections/Patreon')
}
]
}
]
},
Expand Down Expand Up @@ -131,31 +101,6 @@ const routes = [
{
path: 'login',
component: lazyLoad('Login/Login')
},
{
path: 'signup',
component: lazyLoad('Login/Signup')
},
{
path: 'password',
component: lazyLoad('Login/Password/Root'),
redirect: '/account/password/reset',
children: [
{
path: 'reset',
component: lazyLoad('Login/Password/Reset')
},
{
path: 'recover/:uuid/:secret',
component: lazyLoad('Login/Password/Recover'),
props: true
}
]
},
{
path: 'activate/:uuid/:secret',
component: lazyLoad('Login/Activate'),
props: true
}
]
},
Expand Down
99 changes: 0 additions & 99 deletions src/views/Login/Activate.vue

This file was deleted.

51 changes: 0 additions & 51 deletions src/views/Login/LoadingView.vue

This file was deleted.

136 changes: 16 additions & 120 deletions src/views/Login/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,148 +2,44 @@
<form class="login100-form">
<span class="login100-form-title">Login</span>

<div class="signup-form" :class="{'fadeout': fadeout}" v-if="!requestStarted">
<div class="wrap-input100 m-b-23 validate-input"
v-bind:class="{'alert-validate': username === '' && first.username}"
:data-validate="'Email is Required'">
<span class="label-input100">Email</span>
<input class="input100" @keydown="first.username = true" v-model="username" type="email" name="username"
placeholder="Type your email">
<span class="focus-input100 username" data-symbol="person_outline"></span>
</div>

<div class="wrap-input100 validate-input" v-bind:class="{'alert-validate': password === '' && first.password}"
:data-validate="'Password is Required'">
<span class="label-input100 ">Password</span>
<input class="input100" @keydown="first.password = true" v-model="password" type="password" name="pass"
placeholder="Type your password">
<span class="focus-input100 password" data-symbol="&#xf190;"></span>
</div>

<div class="forgot-pw">
<router-link :to="'/account/password/reset'">Forgot password?</router-link>
</div>
<div class="moved-notice">
<p><b>Login has moved.</b></p>
<p>OpenShock has a new website. Please head over there to sign in.</p>
<p>Once you're signed in you can come straight back here and keep using this site.</p>

<div class="container-login100-form-btn">
<div class="wrap-login100-form-btn">
<div class="login100-form-bgbtn"></div>
<button v-on:click.prevent="sendLogin" class="login100-form-btn">Login</button>
<a :href="newFrontendUrl" class="login100-form-btn">Continue to OpenShock</a>
</div>
</div>

<div class="sep-or">
<span class="txt1">Or</span>
<router-link :to="'/account/signup'" class="txt2">Register</router-link>
</div>
</div>
<div v-else>
<loading-view :loading="!requestDone" :error="!successful"
:successText="'<p><b>Successfully logged in!</b></p><p>Redirecting to <br><b><u>Dashboard</u></b></p>'"
:errorText="errorMessage"/>
<div class="sep-or">
<a class="txt2" @click="resetAll">Go Back</a>
</div>
</div>
</form>
</template>

<script>
import axios from 'axios';
import LoadingView from './LoadingView';

// The v1 account auth endpoints have been retired (OpenShock/API#322). Authentication
// now lives on the new OpenShock website, so this page redirects users there instead.
export default {
components: {
LoadingView
},
data() {
return {
username: "",
password: "",
errorMessage: "<p><b>Something went terribly wrong.</b></p><p>Please check your internet connection or contact our support.</p>",
fadeout: false,
requestStarted: false,
requestDone: false,
successful: false,
first: {
username: false,
password: false
}
}
},
methods: {
async sendLogin() {
if (this.username === "" || this.password === "") return;

this.fadeout = true;
setTimeout(() => {
this.requestStarted = true;
}, 300)
try {
const res = await axios({
method: 'POST',
url: config.apiUrl + '1/account/login',
data: {
email: this.username,
password: this.password
}
});

this.successful = true;
setTimeout(() => {
const returnUrl = this.$store.state.returnUrl;
if(returnUrl !== undefined) {
this.$store.dispatch('setReturnUrl', undefined);
this.$router.push(returnUrl);
return;
}
this.$router.push('/dashboard/');
}, 2500)
} catch (err) {
if (err.response !== undefined) {
switch (err.response.status) {
case 401:
this.errorMessage = '<p><b>Credentials did not match any account.</b></p>';
break;
case 403:
this.errorMessage = '<p><b>Account not activated</b></p>';
break;
default:
if(err.response.data.Message !== undefined && err.response.data.message !== "") {
this.errorMessage = '<p><b>Something went wrong.</b></p><p>' + err.response.data.message + '</p>';
} else {
toastr.error(err);
}
break;
}
} else {
toastr.error(err);
}
}
this.requestDone = true;
},
resetAll() {
this.successful = false;
this.fadeout = false;
this.requestStarted = false;
this.requestDone = false;
this.errorMessage = "<p><b>Something went terribly wrong.</b></p><p>Please check your internet connection or contact our support.</p>";
newFrontendUrl: 'https://openshock.app'
}
}
}
</script>

<style scoped>
.signup-form.fadeout {
position: relative;
height: calc(100% - 100px);
.moved-notice {
text-align: center;
}

left: 0;
animation: slide 0.3s forwards;
.moved-notice p {
color: #555;
margin-bottom: 10px;
}

@keyframes slide {
100% {
left: -500px;
}
.moved-notice .container-login100-form-btn {
margin-top: 30px;
}
</style>
Loading
Loading