package ovh.herisson.Clyde.EndPoints;



import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import ovh.herisson.Clyde.Services.TokenService;
import ovh.herisson.Clyde.Tables.Token;

@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class TokenController {

    private final TokenService tokenServ;

    public TokenController(TokenService tokenServ){
        this.tokenServ = tokenServ;
    }


    @GetMapping("/tokens")
    public Iterable<Token> getTokens(){
        return tokenServ.getAllTokens();
    }
}
