Relog function + option validation by key

add option validation by enter key
Add relog function when token is outdated