Fix issues (#158)
* Fix accept all button simply not working * Switched privacy settings icons to a shield Fixed auth changing the theme and consent Fixed server error on log in / out * Fixed scrolling issue on mobile * Fixed GPDR concerns
This commit is contained in:
parent
c06c3d48d2
commit
487c1a58d6
@ -16,5 +16,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
plugins: ['prettier'],
|
plugins: ['prettier'],
|
||||||
// add your custom rules here
|
// add your custom rules here
|
||||||
rules: {},
|
rules: {
|
||||||
|
'no-console': 'off',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
1
assets/images/utils/shield.svg
Normal file
1
assets/images/utils/shield.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shield"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 279 B |
@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<ReviewPopup ref="popup" />
|
|
||||||
<div
|
<div
|
||||||
ref="container"
|
ref="container"
|
||||||
class="container"
|
class="container"
|
||||||
@ -22,6 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import scopes from '~/privacy-toggles'
|
||||||
export default {
|
export default {
|
||||||
name: 'CookieConsent',
|
name: 'CookieConsent',
|
||||||
fetch() {
|
fetch() {
|
||||||
@ -42,8 +42,10 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
hide() {
|
hide() {
|
||||||
this.$store.commit('consent/set_consent', true)
|
this.$store.commit('consent/set_consent', true)
|
||||||
this.$store.commit('consent/add_scope', true)
|
// Accept all scopes
|
||||||
this.$store.commit('consent/remove_scope', true)
|
for (const elem in scopes.settings) {
|
||||||
|
this.$store.commit('consent/add_scope', elem)
|
||||||
|
}
|
||||||
this.$store.dispatch('consent/save', this.$cookies)
|
this.$store.dispatch('consent/save', this.$cookies)
|
||||||
|
|
||||||
this.shown = false
|
this.shown = false
|
||||||
|
|||||||
@ -1,24 +0,0 @@
|
|||||||
<template>
|
|
||||||
<Popup :show-popup="shown"> </Popup>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'ReviewPopup',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
shown: false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
show() {
|
|
||||||
this.shown = true
|
|
||||||
},
|
|
||||||
hide() {
|
|
||||||
this.shown = false
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
|
||||||
@ -165,6 +165,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$route() {
|
||||||
this.$refs.nav.className = 'right-group'
|
this.$refs.nav.className = 'right-group'
|
||||||
|
document.body.style.overflow = 'auto'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -186,7 +187,18 @@ export default {
|
|||||||
},
|
},
|
||||||
async logout() {
|
async logout() {
|
||||||
this.$cookies.set('auth-token-reset', true)
|
this.$cookies.set('auth-token-reset', true)
|
||||||
await this.$router.go(null)
|
// If users logs out on dashboard, redirect on the home page
|
||||||
|
if (this.$route.path.startsWith('/dashboard')) {
|
||||||
|
await this.$router.push('/')
|
||||||
|
} else {
|
||||||
|
await this.$router.go(null)
|
||||||
|
}
|
||||||
|
this.$notify({
|
||||||
|
group: 'main',
|
||||||
|
title: 'Logged Out',
|
||||||
|
text: 'You have logged out successfully!',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
},
|
},
|
||||||
changeTheme() {
|
changeTheme() {
|
||||||
this.$colorMode.preference =
|
this.$colorMode.preference =
|
||||||
@ -198,6 +210,8 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.layout {
|
.layout {
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
background-color: var(--color-bg);
|
background-color: var(--color-bg);
|
||||||
display: block;
|
display: block;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|||||||
@ -1,18 +1,17 @@
|
|||||||
export default async function (context) {
|
export default async function (context) {
|
||||||
if (!context.from) {
|
if (!context.from) {
|
||||||
if (context.app.$cookies.get('auth-token-reset')) {
|
if (context.app.$cookies.get('auth-token-reset')) {
|
||||||
context.app.$cookies.removeAll()
|
// Only remove the cookie related to the auth, instead of removing everything
|
||||||
|
context.app.$cookies.remove('auth-token')
|
||||||
|
context.app.$cookies.remove('auth-token-reset')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.route.query.code) {
|
if (context.route.query.code) {
|
||||||
const date = new Date()
|
const date = new Date(Date.now() + 6 * 60 * 60 * 1000) // 6 hours
|
||||||
date.setFullYear(new Date().getFullYear() + 1)
|
|
||||||
|
|
||||||
context.app.$cookies.set('auth-token', context.route.query.code, {
|
context.app.$cookies.set('auth-token', context.route.query.code, {
|
||||||
secure: true,
|
secure: true,
|
||||||
sameSite: 'Strict',
|
sameSite: 'Strict',
|
||||||
maxAge: 60 * 60 * 2, // 2 hours
|
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
expires: date,
|
expires: date,
|
||||||
path: '/',
|
path: '/',
|
||||||
|
|||||||
@ -10,8 +10,6 @@ function isAnalyticsOn(ctx) {
|
|||||||
cookies = document.cookie;
|
cookies = document.cookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!cookies) return true;
|
|
||||||
|
|
||||||
let processed = {}
|
let processed = {}
|
||||||
cookies.split(';').forEach((e) => {
|
cookies.split(';').forEach((e) => {
|
||||||
let val = e.trim().split('=');
|
let val = e.trim().split('=');
|
||||||
|
|||||||
@ -9,9 +9,6 @@ function isPersonalizedAdsOn(ctx) {
|
|||||||
// Rely on the client
|
// Rely on the client
|
||||||
cookies = document.cookie;
|
cookies = document.cookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!cookies) return true;
|
|
||||||
|
|
||||||
let processed = {}
|
let processed = {}
|
||||||
cookies.split(';').forEach((e) => {
|
cookies.split(';').forEach((e) => {
|
||||||
let val = e.trim().split('=')
|
let val = e.trim().split('=')
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
Settings
|
Settings
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
<nuxt-link :to="'/dashboard/privacy'" class="tab last">
|
<nuxt-link :to="'/dashboard/privacy'" class="tab last">
|
||||||
<SettingsIcon />
|
<ShieldIcon />
|
||||||
Privacy Settings
|
Privacy Settings
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
@ -60,6 +60,7 @@ import SettingsIcon from '~/assets/images/sidebar/settings.svg?inline'
|
|||||||
import NotificationsIcon from '~/assets/images/sidebar/notifications.svg?inline'
|
import NotificationsIcon from '~/assets/images/sidebar/notifications.svg?inline'
|
||||||
import FollowIcon from '~/assets/images/utils/heart.svg?inline'
|
import FollowIcon from '~/assets/images/utils/heart.svg?inline'
|
||||||
import UserIcon from '~/assets/images/utils/user.svg?inline'
|
import UserIcon from '~/assets/images/utils/user.svg?inline'
|
||||||
|
import ShieldIcon from '~/assets/images/utils/shield.svg?inline'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DashboardPage',
|
name: 'DashboardPage',
|
||||||
@ -70,6 +71,7 @@ export default {
|
|||||||
NotificationsIcon,
|
NotificationsIcon,
|
||||||
FollowIcon,
|
FollowIcon,
|
||||||
UserIcon,
|
UserIcon,
|
||||||
|
ShieldIcon,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
authUrl() {
|
authUrl() {
|
||||||
|
|||||||
@ -90,6 +90,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$store.dispatch('consent/save', this.$cookies)
|
this.$store.dispatch('consent/save', this.$cookies)
|
||||||
|
this.$notify({
|
||||||
|
group: 'main',
|
||||||
|
title: 'Saved',
|
||||||
|
text: 'Your preferences have been saved successfully.',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,21 +22,25 @@ export const mutations = {
|
|||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
async fetchUser({ commit }, { token }) {
|
async fetchUser({ commit }, { token }) {
|
||||||
const user = (
|
try {
|
||||||
await this.$axios.get(`https://api.modrinth.com/api/v1/user`, {
|
const user = (
|
||||||
|
await this.$axios.get(`https://api.modrinth.com/api/v1/user`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: token,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
).data
|
||||||
|
|
||||||
|
commit('SET_USER', user)
|
||||||
|
commit('SET_TOKEN', token)
|
||||||
|
commit('SET_HEADERS', {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: token,
|
Authorization: token,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
).data
|
} catch (e) {
|
||||||
|
console.error('Request for user info encountered an error: ', e)
|
||||||
commit('SET_USER', user)
|
}
|
||||||
commit('SET_TOKEN', token)
|
|
||||||
commit('SET_HEADERS', {
|
|
||||||
headers: {
|
|
||||||
Authorization: token,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
async fetchUserFollows({ commit }, { userId, token }) {
|
async fetchUserFollows({ commit }, { userId, token }) {
|
||||||
const follows = await this.$axios.get(
|
const follows = await this.$axios.get(
|
||||||
@ -47,7 +51,6 @@ export const actions = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
commit('SET_USER_FOLLOWS', follows)
|
commit('SET_USER_FOLLOWS', follows)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user