Added proper imports

This commit is contained in:
Douglas Barone 2023-10-20 15:32:25 -04:00
parent 7b21a5996b
commit 34425a8a0c
6 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,5 @@
import { Auth, LoginResult } from '../interfaces/Auth'
export class FakeAuth implements Auth { export class FakeAuth implements Auth {
constructor() {} constructor() {}

View File

@ -1,4 +1,5 @@
import { Client } from 'ldapts' import { Client } from 'ldapts'
import { Auth, LoginResult } from '../interfaces/Auth'
export class LdapAuth implements Auth { export class LdapAuth implements Auth {
constructor( constructor(

View File

@ -1,10 +1,10 @@
type LoginResult = { export type LoginResult = {
username: string username: string
displayName: string displayName: string
domain: string domain: string
jwt?: string jwt?: string
} }
interface Auth { export interface Auth {
login(username: string, password: string): Promise<LoginResult> | LoginResult login(username: string, password: string): Promise<LoginResult> | LoginResult
} }

View File

@ -25,6 +25,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { PropType } from 'vue' import { PropType } from 'vue'
import { trpc } from '../trpc' import { trpc } from '../trpc'
import { LoginResult } from '@/server/interfaces/Auth'
const props = defineProps({ const props = defineProps({
loginResult: { loginResult: {
@ -40,6 +41,7 @@ async function onLogout() {
}) })
if (success) { if (success) {
alert('Você foi desconectado.')
window.location.reload() window.location.reload()
} else { } else {
alert('Não foi possível fazer logout. Tente novamente.') alert('Não foi possível fazer logout. Tente novamente.')

View File

@ -48,6 +48,7 @@
color="primary" color="primary"
:variant="'flat'" :variant="'flat'"
type="submit" type="submit"
:loading="loading"
> >
Login Login
</v-btn> </v-btn>

View File

@ -18,6 +18,7 @@ import IpAlert from '../components/IpAlert.vue'
import Logo from '../components/Logo.vue' import Logo from '../components/Logo.vue'
import LoggedCard from '../components/LoggedCard.vue' import LoggedCard from '../components/LoggedCard.vue'
import { ref } from 'vue' import { ref } from 'vue'
import { LoginResult } from '@/server/interfaces/Auth'
const loginResult = ref<LoginResult | null>(null) const loginResult = ref<LoginResult | null>(null)