@@ -0,0 +1,1511 @@
+package com.coding4people.mosquitoreport.api.controllers;%0D%0A%0D%0Aimport javax.inject.Inject;%0D%0Aimport javax.validation.Valid;%0D%0Aimport javax.validation.constraints.NotNull;%0D%0Aimport javax.ws.rs.Consumes;%0D%0Aimport javax.ws.rs.ForbiddenException;%0D%0Aimport javax.ws.rs.POST;%0D%0Aimport javax.ws.rs.Path;%0D%0Aimport javax.ws.rs.Produces;%0D%0A%0D%0Aimport com.coding4people.mosquitoreport.api.models.Email;%0D%0Aimport com.coding4people.mosquitoreport.api.repositories.EmailRepository;%0D%0A%0D%0A@Path(%22/auth/email%22)%0D%0Apublic class AuthEmailController %7B%0D%0A    @Inject%0D%0A    EmailRepository emailRepository;%0D%0A%0D%0A    @POST%0D%0A    @Consumes(%22application/json%22)%0D%0A    @Produces(%22application/json;charset=UTF-8%22)%0D%0A    public Email auth(@Valid AuthInput input) %7B%0D%0A        Email email = emailRepository.load(input.getEmail());%0D%0A        %0D%0A        if (email == null %7C%7C !Email.checkPassword(input.getPassword(), email.getPassword())) %7B%0D%0A            throw new ForbiddenException(%22Invalid email or password%22);%0D%0A        %7D%0D%0A%0D%0A        return email;%0D%0A    %7D%0D%0A%0D%0A    public static class AuthInput %7B%0D%0A        @NotNull%0D%0A        private String email;%0D%0A        %0D%0A        @NotNull%0D%0A        private String password;%0D%0A%0D%0A        public String getEmail() %7B%0D%0A            return email;%0D%0A        %7D%0D%0A%0D%0A        public void setEmail(String email) %7B%0D%0A            this.email = email;%0D%0A        %7D%0D%0A%0D%0A        public String getPassword() %7B%0D%0A            return password;%0D%0A        %7D%0D%0A%0D%0A        public void setPassword(String password) %7B%0D%0A            this.password = password;%0D%0A        %7D%0D%0A    %7D%0D%0A%7D%0D%0A

Add auth email controller