fix js authentication