authorization kinda working without refreshing page