Files
habitica/website/client/src/components/bannedAccountModal.vue
negue 6fdc072ec3 reset the ApiToken on password changes/resets (#15433)
* reset the ApiToken on password changes/resets

* fix/add tests

* fix(typo): test grammar

* update new API Token Strings, removed unused one

---------

Co-authored-by: Kalista Payne <sabrecat@gmail.com>
2025-07-01 12:30:34 -05:00

60 lines
1.3 KiB
Vue

<template>
<b-modal
id="banned-account"
:title="$t('accountSuspendedTitle')"
size="md"
:hide-footer="true"
>
<div class="modal-body">
<div class="row">
<div class="col-12">
<p v-markdown="bannedMessage"></p>
</div>
</div>
</div>
<div class="modal-footer">
<div class="col-12 text-center">
<button
class="btn btn-primary"
@click="close()"
>
{{ $t('close') }}
</button>
</div>
</div>
</b-modal>
</template>
<style scoped>
</style>
<script>
import markdownDirective from '@/directives/markdown';
import { LOCALSTORAGE_AUTH_KEY } from '@/libs/auth';
const COMMUNITY_MANAGER_EMAIL = import.meta.env.EMAILS_COMMUNITY_MANAGER_EMAIL; // eslint-disable-line
export default {
directives: {
markdown: markdownDirective,
},
computed: {
bannedMessage () {
const AUTH_SETTINGS = localStorage.getItem(LOCALSTORAGE_AUTH_KEY);
const parseSettings = JSON.parse(AUTH_SETTINGS);
const userId = parseSettings ? parseSettings.auth.apiId : '';
return this.$t('accountSuspended', {
userId,
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
});
},
},
methods: {
close () {
this.$root.$emit('bv::hide::modal', 'banned-account');
},
},
};
</script>