Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
fix(auth): fixed getters
Browse files Browse the repository at this point in the history
  • Loading branch information
adrrf committed Feb 29, 2024
1 parent 190efde commit d4e4803
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/store/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
useStorage,
type RemovableRef
} from '@vueuse/core';
import { computed } from 'vue';
import { defuSchema } from '@/utils/data-manipulation';

/**
Expand Down Expand Up @@ -46,21 +47,13 @@ class AuthStore {
* == GETTERS AND SETTERS ==
*/

public readonly name = (): string | undefined => {
return this._state.value.name;
};
public readonly name = computed(() => this._state.value.name);

public readonly id = (): number | undefined => {
return this._state.value.id;
};
public readonly id = computed(() => this._state.value.id);

public readonly isClient = (): boolean | undefined => {
return this._state.value.isClient;
};
public readonly isClient = computed(() => this._state.value.isClient);

public readonly token = (): string | undefined => {
return this._state.value.token;
};
public readonly token = computed(() => this._state.value.token);

public authenticate = (): void => {
// Todo: lógica de login call backend
Expand Down

0 comments on commit d4e4803

Please sign in to comment.