add authentication logic

@janeeats check this out