@startuml

class AuthController {
    +__construct (model : AuthModel)
    + displayRegister() : HttpResponse
    + register(request : array,session : MutableSessionHandle) : HttpResponse
    + displayLogin() : HttpResponse
    + login(request : array , session : MutableSessionHandle) : HttpResponse
}
AuthController *-- "- model" AuthModel

class AuthModel {
    + __construct(gateway : AccountGateway)
    + register(username:string, password:string, confirmPassword:string, email:string, &failures:array): ?Account    + generateToken() : string
    + generateToken(): string
    + login(email:string, password:string, &failures:array): ?Account
}
AuthModel *-- "- gateway" AccountGateway

class AccountGateway{
    + __construct(con : Connexion)
    + insertAccount(name:string, email:string, token:string, hash:string, profilePicture:string): int
    + getRowsFromMail(email:string): ?array
    + getHash(email:string): ?string
    + exists(email:string): bool
    + getAccountFromMail(email:string): ?Account
    + getAccountFromToken(token:string): ?Account
}

AccountGateway *--"- con" Connexion

@enduml