Api token for bearer auth stops working after ~ 12h

my code is aaa - Pastebin.com
sorry for late reply client didnt respond in hell of a long time
pls dont be too harsh on the shityness