Skip to content

Commit

Permalink
hotfix (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusbrg authored Jan 30, 2025
1 parent c8d44ed commit 1c4022c
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 237 deletions.
44 changes: 22 additions & 22 deletions apps/container/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import { authStore } from 'stores';
import NextClassView from '@/views/Partners/NextClass/NextClassView.vue';
// import NextClassView from '@/views/Partners/NextClass/NextClassView.vue';
const ReviewsView = () => import('@/views/Reviews/ReviewsView.vue');
const PerformanceView = () => import('@/views/Performance/PerformanceView.vue');
const PlanningView = () => import('@/views/Planning/PlanningView.vue');
Expand All @@ -13,7 +13,7 @@ const ConfirmationView = () =>
import('@/views/Confirmation/ConfirmationView.vue');
const RecoveryView = () => import('@/views/Recovery/RecoveryView.vue');
const CalengradeView = () => import('@/views/Calengrade/CalengradeView.vue');
const FacebookView = () => import('@/views/Facebook/FacebookView.vue');
// const FacebookView = () => import('@/views/Facebook/FacebookView.vue');

const isJWT = (token: string) =>
/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_.+/=]*$/.test(token);
Expand Down Expand Up @@ -117,25 +117,25 @@ const routes: Array<RouteRecordRaw> = [
title: 'Calengrade',
},
},
{
path: '/autenticar-facebook',
name: 'Autenticar Facebook',
component: FacebookView,
meta: {
title: 'Autenticar Facebook',
auth: false,
},
},
{
path: '/partners',
name: 'Next Class Noc',
component: NextClassView,
meta: {
title: 'Next Class Noc',
auth: false,
confirmed: true,
},
},
// {
// path: '/autenticar-facebook',
// name: 'Autenticar Facebook',
// component: FacebookView,
// meta: {
// title: 'Autenticar Facebook',
// auth: false,
// },
// },
// {
// path: '/partners',
// name: 'Next Class Noc',
// component: NextClassView,
// meta: {
// title: 'Next Class Noc',
// auth: false,
// confirmed: true,
// },
// },
{
path: '/:pathMatch(.*)*',
redirect: (to) => {
Expand Down Expand Up @@ -189,7 +189,7 @@ router.beforeEach(async (to, _from, next) => {
const isLocal = process.env.VUE_APP_MF_ENV === 'local';

const notConfirmedRedirectPath = '/signup';
const authenticatedRedirectPath = '/partners';
const authenticatedRedirectPath = '/reviews';
const notAuthenticatedRedirect = () =>
isLocal ? next(notConfirmedRedirectPath) : (window.location.pathname = '/');

Expand Down
9 changes: 5 additions & 4 deletions apps/container/src/views/Facebook/FacebookView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useForm, useField } from 'vee-validate';
import { ElMessage } from 'element-plus';
import { useAuth } from '@/stores/useAuth';
import { Users } from 'services';
// import { Users } from 'services';
const facebookNotFound = ref(false);
Expand Down Expand Up @@ -36,7 +36,7 @@ const { value: emailField, errorMessage: emailErrorMessage } =
useField('email');
const { value: raField, errorMessage: raErrorMessage } = useField('ra');
const { mutate: mutateFacebook, isPending: isPendingSubmit } = useMutation({

Check failure on line 38 in apps/container/src/views/Facebook/FacebookView.vue

View workflow job for this annotation

GitHub Actions / quality (lint)

'mutateFacebook' is assigned a value but never used
mutationFn: Users.facebookAuth,
mutationFn: () => { },
onSuccess({ data }) {
ElMessage({
message: 'Realizando seu login',
Expand All @@ -55,8 +55,9 @@ const { mutate: mutateFacebook, isPending: isPendingSubmit } = useMutation({
const windowLocation = window.location;
const redirectToHome = () => (windowLocation.pathname = '/');
const onSubmit = handleSubmit(({ email, ra }) =>
mutateFacebook({ email: email.toLowerCase(), ra }),
const onSubmit = handleSubmit(() =>
// mutateFacebook({ email: email.toLowerCase(), ra }),
{console.log('ai papai')}

Check warning on line 60 in apps/container/src/views/Facebook/FacebookView.vue

View workflow job for this annotation

GitHub Actions / quality (lint)

Unexpected console statement
);
</script>

Expand Down
10 changes: 5 additions & 5 deletions apps/container/src/views/Settings/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
Usuário desde {{ createdAt }}
</div>
<div style="display: flex; flex-direction: column; gap: 10px">
<a href="#" class="links-settings" v-if="user?.oauth?.facebook">
<!-- <a href="#" class="links-settings" v-if="user?.oauth?.facebook">
<v-icon color="ufabcnext-green">mdi-check</v-icon>
Conta do Facebook associada
</a>
<a :href="addFacebookAccount" target="_blank" class="links-settings add-account" v-else-if="user">
<v-icon color="ufabcnext-blue" class="mr-2">mdi-plus-circle-outline</v-icon>
Associar à uma conta do Facebook
</a>
</a> -->

<a href="#" class="links-settings" v-if="user?.oauth?.google">
<v-icon color="ufabcnext-green">mdi-check</v-icon>
Expand Down Expand Up @@ -126,9 +126,9 @@ const addGoogleAccount = computed(() => {
return apiPath + 'connect/google?userId=' + user.value?._id;
});
const addFacebookAccount = computed(() => {
return apiPath + 'connect/facebook?userId=' + user.value?._id;
});
// const addFacebookAccount = computed(() => {
// return apiPath + 'connect/facebook?userId=' + user.value?._id;
// });
const createdAt = computed(() => {
if (user.value?.createdAt) {
Expand Down
Loading

0 comments on commit 1c4022c

Please sign in to comment.