Rename
This commit is contained in:
parent
1217b53213
commit
2771b3cd96
|
@ -1,6 +1,6 @@
|
||||||
import { Client } from 'ldapts'
|
import { Client } from 'ldapts'
|
||||||
|
|
||||||
export class LdapLogin implements Login {
|
export class LdapAuth implements Auth {
|
||||||
constructor(
|
constructor(
|
||||||
private client: Client,
|
private client: Client,
|
||||||
private domain: string,
|
private domain: string,
|
|
@ -4,6 +4,6 @@ type LoginResult = {
|
||||||
jwt?: string
|
jwt?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Login {
|
interface Auth {
|
||||||
login(username: string, password: string): Promise<LoginResult>
|
login(username: string, password: string): Promise<LoginResult>
|
||||||
}
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
import { Client } from 'ldapts'
|
import { Client } from 'ldapts'
|
||||||
|
|
||||||
import { LdapLogin } from '../classes/LdapLogin'
|
import { LdapAuth } from '../Auth/LdapAuth'
|
||||||
|
|
||||||
export async function login(username: string, password: string) {
|
export async function login(username: string, password: string) {
|
||||||
const ldapClient = new Client({
|
const ldapClient = new Client({
|
||||||
url: 'ldap://10.7.0.18'
|
url: 'ldap://10.7.0.18'
|
||||||
})
|
})
|
||||||
|
|
||||||
const ldapLogin = new LdapLogin(ldapClient, 'ifms', 'DC=ifms,DC=edu,DC=br')
|
const ldapAuth = new LdapAuth(ldapClient, 'ifms', 'DC=ifms,DC=edu,DC=br')
|
||||||
|
|
||||||
const result = await ldapLogin.login(username, password)
|
const result = await ldapAuth.login(username, password)
|
||||||
|
|
||||||
console.log('Login result:', result)
|
console.log('Login result:', result)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user