package auth import ( "fmt" "os" "testing" ) // Live smoke test against the real login service. Opt-in so plain `go test` // stays offline: LIVE=1 go test ./auth/ -run TestLiveStoredToken func TestLiveStoredToken(t *testing.T) { if os.Getenv("LIVE") == "" { t.Skip("set LIVE=1 to run against the live login service") } for _, region := range []int{1, 2} { topURL := fmt.Sprintf( "https://ffxiv-login.square-enix.com/oauth/ffxivarr/login/top?lng=en&rgn=%d&isft=0&cssmode=1&isnew=1&launchver=3", region) stored, err := getStored(topURL) if err != nil { t.Fatalf("region %d: %v", region, err) } if len(stored) < 8 { t.Errorf("region %d: suspiciously short _STORED_ token %q", region, stored) } else { t.Logf("region %d: got _STORED_ of %d chars (prefix %.4s...)", region, len(stored), stored[:4]) } } if id := ComputerID(); len(id) != 10 { t.Errorf("ComputerID should be 5 bytes / 10 hex chars, got %q", id) } else { t.Logf("computerId=%s userAgent=%q", id, UserAgent()) } }